Hello World example

For the Hello World Example to run we first need to make sure we can use the Management Console of MailerQ and the SMTP port is reachable. First we start up our installed version of MailerQ

Start MailerQ and connect RabbitMQ

To start RabbitMQ as an administrator, start the server for RPM-based systems using:

sudo systemctl enable rabbitmq-server
sudo systemctl start rabbitmq-server

MailerQ uses port 80 to show the Management Console. This is the default HTTP port. Any Apache or nginx servers will most likely use this port. You can stop them or you can adjust the HTTP port that MailerQ uses. Just modify the www-port variable in MailerQ config.

# Management console configuration
www-port: 8485

MailerQ also runs a SMTP server and it will try to use port 25 for it. That means that you have to stop any other SMTP servers before starting MailerQ (e.g. postfix). Alternatively, you can change MailerQ's SMTP port. Just modify the smtp-port variable in MailerQ config (e.g. 2525 will work just fine).

smtp-port: 2525

Within this config file you can configure MailerQ, to change the Management Console password for example. Although all other config file settings have decent defaults, you might want to take a look at them.

After you connected MailerQ to RabbitMQ you can start MailerQ

sudo systemctl start mailerq

Run the Hello World Example

Go to your localhost or localhost:8485 to access the MailerQ Management Console and send your first email with MailerQ!

The simplest example to send a message using MailerQ is via the cli:

echo -e "from: your_email@domain.com\nto: your_email@domain.com\nsubject: MailerQ example message\n\nHello World" | mailerq --extract-recipients --ignore-dot

If you are fast enough, you can track this message in the management console.