This guide will help you to use Mailjet SMTP service as Outgoing SMTP Server in cPanel & WHM with Exim.
Mailjet is a transactional email service. It comes stock with a powerful API for fast implementation into applications for sending email reliably over SMTP, but it can also be used as a smart host for all of your server’s outgoing email.
I’m running a CentOs 7 instance running cPanel on GCP ( Google Cloud Platform) and this tutorial is just a workaround for sending email into inbox safely , because GCP block port 25 which is responsible for sending outgoing emails to another mailboxes
The below instructions cover how to do this via WHM, simply go to WHM -> Exim Configuration Manager -> Advanced Editor and alter the sections indicated.
Click on Advanced Editor.
Scroll down and go to Section: AUTH and add below lines of code:
driver = plaintext
public_name = LOGIN
client_send = : USERNAME : PASSWORD
and sure replace Username and Password with Mailjet credentials as you can find it in your account here if you didn’t have an account you can simply signup for free and you will see the credentials in your dashboard like this.
Go to Section: ROUTERSTART and add below lines of code:
driver = manualroute
domains = ! +local_domains
transport = mailjet_smtp
route_list = * in-v3.mailjet.com
Go to Section: TRANSPORTSTART and add below lines of code:
driver = smtp
port = 587
hosts = in-v3.mailjet.com
hosts_require_auth = in-v3.mailjet.com
Click the Save button. This will restart exim. If exim does not restart, then restart it manually from Restart Services > Mail Server (EXIM).
Mailjet requires to add the domain which have the ability to send to a list therefore you have to login into Mailjet account and go to Configuration >> Manage sender domains and addresses you can visit the link here
as you can see there I have added a one domain and I can add more , when you add a new one they will require a verification of domain ownership with uploading a txt file with a given name or with provided DNS record an both works fine.
All done. In conclusion, Your outgoing email on your server are goes through Mailjet. 🙂