I am trying to send a very basic mail with PHP using the below code;
if (mail('mymail@gmail.com','Test mail','Testing mail function!'))
{
echo "Email was sent successfully!";
}
else
{
echo "Email was not sent!";
}
However, the output is always 'Email was not sent'. I am running this script locally on my machine using Xaamp.
I already tried to research a solution for this but I had no luck. It seems like it's something to do with server configuration. I tried to modify sendmail in php.ini but it still didn't work.
Any help on this is greatly appreciated.
Thank you.