I have a problem with my php:I want to send a simple mail in php..I using XAMPP My configure is: php.ini: only sendmail and mail.add_x_header is not commented
; For Win32 only.
; http://php.net/smtp
;SMTP = smtp.gmail.com
; http://php.net/smtp-port
;smtp_port = 587
sendmail_path = "C:\xampp\sendmail\sendmail.exe\" -t"
mail.add_x_header = Off
sendmail.ini:
smtp_server=smtp.gmail.com
;smtp port (normally 25)
smtp_port=587
smtp_ssl=true
auth_username=myemail@gmail.com
auth_password=mypassword
and index.php
<?php
$subject="Hi There!!";
$to="nick@yahoo.com";
$body="This is my demo email sent using PHP on XAMPP";
if (mail($to,$subject,$body))
echo "Mail sent successfully!";
else
echo "Mail not sent!";
?>
It runs without errors but the mail does not come...Where is my error ?pliz help me