How to configure another droplet to send emails?

I have 2 droplets. The one is a mailserver and the other one is the one that has the website which is wordpress. How can I configure the wordpress/droplet to send eimails from the mailserver? I would like a full answer please meaning, what do I need to install and how to configure on both droplets, what ports to open for firewall and what records to add in DNS. Thank you.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I use Exim4 on my droplet with WordPress/PHP websites: <br> <br>That is so that my droplet can send emails. <br> <br>Then for my second droplet, my mail server, I use iRedMail: <br> <br>Both tutorials are very easy to follow, and iRedMail comes with everything fully set up. Though with the nature of antiviruses, Clamav and SpamAssassin take quite a bit of resources so you should deploy with at least 1GB memory (the $10 droplet). You can do with much less RAM, but that’s only if you’re willing to dig into your configs and remove certain packages from your installation. Otherwise, iRedMail runs very smoothly with the required 1GB. <br> <br>So for your DNS, you’d do something like this: <br> <br>A record:, which points to your mail server’s IP address. <br>MX: with a high priority (low number, can be anything. I use 5). <br> <br>And a TXT record: with its text being something like: “v=spf1 ip(wordpressdropletsIP) ip(mailserverIP) ~all” <br> <br>Replace (wordpressdropletsIP) and (mailserverIP) with actual IP numbers, without the brackets. <br> <br>That’s all that’s really needed. The entire process will take less than 30 minutes, unless you run into any trouble. Also, Google will help for anything if you need to find some quick information on something specific. Or just post here.