Do you want your servers to send mails with a dedicated mailing service in order to gain more control and logs about the mail delivery?

Powerful APIs that enable you to send, receive and track email effortlessly. 10,000 emails free every month.

If you already have postfix properly set up and running, edit /etc/postfix/ and append this:

smtp_sasl_auth_enable = yes
relayhost =
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

Then add your smtp credential of mailgun to postfix:

echo ' [email protected]:password' > /etc/postfix/sasl_passwd

Protect the file and populate it:

chmod 600 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd

And finally restart postfix:

service postfix restart

Now your server should send its mails via mailgun. Just give it a test shot!