Question

send mail from wordpress phpmail (Sendmail / postfix?)

Posted October 13, 2014 4.5k views

Hi
How can I setup phpmail to send email from different wordpress sites hosted on the same VPS?
I need them to send emails only to certain email addresses ie from a contact form. I would rather not use a smtp server if that is possible?
Thanks

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
3 answers

Yes, you can install postfix on your droplet which would allow you to send email without having to use an external SMTP server:

sudo apt-get install postfix

Thankyou for your response. Yes i believed this was the case. Are there any good guides around on how to do this?

  • Sorry to be replying to such an old thread, but did you ever figure this out? I have a couple of websites on my VPS and I’m trying to work out how to get the contact forms to work?

Hello all,

What I could suggest here is using an SMTP plugin for your WordPress site.

That way you will be able to specify an SMTP server with authentication which your emails would be going through. You could for example use SendGrid’s SMTP service. This would drastically increase the delivery rate of your emails as well compared to using plain PHP mail.

I’ve been using this plugin for a while now and it works very well: Easy WP SMTP.

https://www.digitalocean.com/community/tutorials/how-to-get-wordpress-email-notifications-on-a-digitalocean-droplet

Hope that this helps!
Regards,
Alex

by Lyn Muldrow
Sending emails and notifications including form submit verifications and password resets from your WordPress server or Droplet is an essential function. In this tutorial, learn how to use a WordPress Simple Mail Transfer Protocol (SMTP) plugin to send emails from your WordPress Droplet or server.