I'm using windows 7 and xampp 1.8(mercury mail is on) and trying to send email from localhost using gmail id. but its not working. heres my email.php :
<?php
$to="receiver.email@gmail.com";
$subject='the subject';
$message="dfdgh";
$headers='From:my.email@gmail.com'."\r\n".'Host:ssl://smtp.gmail.com'."\r\n".'Port:465'."\r\n".'Username:my.email@gmail.com'."\r\n".'Password:mypassword'."\r\n".'Reply-To:my.email@gmail.com'."\r\n".'X-Mailer:PHP/'.phpversion();
mail($to, $subject, $message, $headers);
?>
and heres my localhost php smtp configuration that I changed
;SMTP = localhost
;smtp_port = 25
SMTP =ssl://smtp.gmail.com
smtp_port = 465
; For Win32 only.
;http://php.net/sendmail-from
;sendmail_from = postmaster@localhost
ssl://smtp.gmail.com
sendmail_from = my.email@gmail.com
I got no error message after I execute the code but didn't receive any email.
What wrong did I do ?
-Thanks.