By caroseuk
Hello all, newb alert!
I was wondering if someone could help me or point me in the right direction…
I have an PHP CodeIgniter application which I am migrating from a managed shared hosting provider and I wanted to test my skills by bringing it into DO. I brought it into DO so that I could implement a HA Proxy load balancer and 3 x Application Server Droplets (1 as backup).
All the app servers are configured identically (CentOS 7) and the load balancer (CentOS 7) is pointing to the app servers in a round robin configuration.
Everything is working as it should apart from e-mails… The issue I am facing is that when the app now tries to use the PHP Mail() function, it fails because i’m guessing there is no mail server set up? The main MX records to the domain are pointing to Microsoft as Office365 is used for managing that aspect. However I would still like all three app servers to be able to send mail from the PHP application (new user registration confirmation/notifications etc…).
As the domain is not pointed to the app servers and instead to the load balancer, how do I configure the app servers to correctly send email from an address? (eg. info@mydomain.com)
Many Thanks, Chris
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!
I was just pondering the same question which is how I found your post. There are two options I’m considering, but first my software already runs phpmailer (free/opensource) which is a very nice interface for sending mail with php and handles a lot of cases and exceptions that you might miss if you were just using PHP’s mail functions.
Something else to consider is where your load is. Having each node send it’s own mail would be great if you have to send a lot of emails. But it might not be worth the cost of extra memory use by the SMTP server. So I think in my case I’m going with option number 1.
The only time we send out a lot of emails is when we do our mailing list / promotional items, but that all comes from one node, so I think i’m just going to put the app that sends those emails on the actual SMTP server, which only our site admins can access.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.