Can not send emails with PHP

advertisements

I'm using LinuxMint 13 and I can't send emails from PHP scripts. I've ran into a lot of configuration with Postfix without any success so I decided to remove it.

I just want to be able to send emails to another computer or/and any email address and to be able to execute functions like imap_open() or imap_mail(). When I had Postfix, these functions would return true, but nothing was sent. So now I'd like to be able to execute this functions. I also want to be able to send emails through an account I'm logged to.

Please tell me what's not working and which package(s) would be useful.

Thanks


If you want to use the PHP mail() function, you just need to install sendmail (sudo apt-get install sendmail). It should set up everything you need to send mail.

Some major ISP's may block your mail because you don't meet requirements for sending (such as having a non-generic hostname, and you need a proper reverse DNS record for your IP address) but that should be all you need in order to send mail from PHP.