Recently I installed msmtp on my ubuntu 12.04 server that is running the kubuntu desktop. The install of msmtp worked fine, and I can even send mail through the terminal using gmail's smtp server.
My problem is that although sending mail works through the terminal, it still doesn't work with php mail. I have tried using the php mail()
function, but I never receive any email.
I have checked the apache error logs (/var/log/apache2/error.log), but they are empty.
Does anyone know how to fix this? If any further information is needed, just say so :)
Also when executing the php script, no errors appear.
The code below echos Mail Sent, but I never recieve an email:
<?
if(mail( 'noreply.njmedia@gmail.com', 'Test mail from localhost', 'Working Fine.'))
{
echo 'Mail sent';
}
else
{
echo 'Error. Please check error log.';
}
?>