Setup PHP mail function.

  • Posted April 3, 2013

Hi there, can anyone tell me how to setup the mail function in PHP on an Ubuntu VPS?

Thanks in advance! Francis


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

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.

For applications with php wordpress mail, just set like this video. Greetings! <br>

Wow! Great! That what I was looking. Perfect!

Good question! <br> <br>SMTP class is an option but network latency between cloud server and SMTP server will delay PHP script. If SMTP server or network would be down then PHP will hang and hole server may hang (e.g. ngnix + 16 FastCGI PHP processes - 16 emails and server is down waiting for SMTP server) <br> <br>With sendmail you send email and forget. <br> <br>Is there lightweight sendmail that will relay email to other SMTP server like Gmail using login/password and SSL?

There’s an excellent tutorial on YouTube that I’ve come across. <br> <br>It looks to me like he’s using the Pear package in this example. <br> <br>Video Here:

I tried the mail function to send an email and I get no errors. But the email just never arrives. <br>Thanks again for the reply. <br> Francis

I believe that the php mail() function will use your local MTA by default which on most normal installed linux servers will just be: <br> <br>/usr/sbin/sendmail <br> <br>Have you tried using the mail function and ran into issues?