How to set up domain on remote CPanel to send mail from droplet

Posted February 26, 2016 6.2k views
EmailControl Panels

I am using an Ubuntu LAMP droplet. I set up an A record to point a subdomain to my droplet that runs a cron job. I would like cron to send an email to my gmail. Since I set up the A record for, I cannot set up a subdomain on cpanel, therefore I cannot create an MX record for that subdomain. If I get rid of the A record and set up a subdomain, it does not route to the droplet.

I set up Postfix and cron tries to send emails, but they don’t go through.

How do I set this up.


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Personally I would recommend using a transactional mailer like sendgrid (who offers 12k email sends a month on their free plan) to handle this type of thing. It is easy to integrate and does not require the amount of attention and initial setup that running a live SMTP service on a public server can.