I need to send mail from PHP code, I am using XAMPP (windows) for PHP. I use mail()
like this:
Here is my code in php.ini:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from =email@gmail.com
My PHP code:
if(mail("email@gmail.com",$subject,$message))
{
echo "mail sent";
}
else
{
echo "error";
}
I get the message 'mail sent' but did not receive an email. What am I doing wrong?