I tried a bunch of stuff but still i can't send email from my local host!
My php.ini file looks like this:
[mail function]
SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = [email protected]
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
;sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"
and my senmail.ini file looks like:
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
[email protected]
auth_password=my-gmail-password //my real pass for this email
[email protected]
And my php code looks like :
$to = "[email protected]";
$subject = "REsttujte vas password";
$message = "This is simple text message.";
$header = "From:[email protected] \r\n";
$retval = mail($to,$subject,$message,$header);
if( $retval == true )
{
echo "Message sent successfully...";
}
else
{
echo "Message could not be sent...";
}
So can someone help me. What is wrong in here? And can You give to me another solution?