Mailtrain is a self-hosted open-source email newsletter application that allows you to send trackable emails via your own self-hosted server. In this tutorial, we will guide you through the process of installing Mailtrain on your Windows 11 machine.
Open Git Bash and navigate to the directory you want to install Mailtrain into. Run the following command to clone the Mailtrain repository:
git clone https://github.com/Mailtrain-org/mailtrain.git
Navigate to the mailtrain
directory and run the following command to install Mailtrain dependencies:
npm install
Open MySQL command line interface and create a new database and user with the following commands:
CREATE DATABASE mailtrain;
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON mailtrain.* TO 'username'@'localhost';
Replace username
and password
with your desired values.
Go to the mailtrain
directory and create a copy of the .env.example
file and name it .env
.
cp .env.example .env
Open the .env
file with a text editor and modify the following values:
DB_HOST=localhost
DB_USER=username
DB_PASSWORD=password
DB_NAME=mailtrain
Replace username
and password
with the values you set in Step 3.
By default, Mailtrain uses the SMTP server smtp.ethereal.email
. If you want to use a different SMTP server, modify the following values in .env
:
MAILER_HOST=smtp.example.com
MAILER_PORT=587
MAILER_SECURE=false
MAILER_USER=user@example.com
MAILER_PASS=password
MAILER_FROM=sender@example.com
MAILER_NAME=MyMailer
Replace smtp.example.com
, user@example.com
, password
, sender@example.com
, and MyMailer
with your desired values.
Run the following command to start Mailtrain:
npm start
After a minute or so, you should see the message Server is listening on port 3000
.
Open your web browser and go to http://localhost:3000
. You should see the Mailtrain login page.
Use the default login credentials to log in:
Email: admin@example.com
Password: admin
Congratulations! You have successfully installed Mailtrain on your Windows 11 machine.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!