Sorry for this question again. I want to send email in PHP for that i used simple mail() function. Using sendmail.exe. Change the php.ini fie like
SMTP = localhost (tried both comment and uncomment this)
smtp_port = 25 tried(587)
sendmail_path = "D:\sendmail\sendmail.exe"
in my sendmailpth.ini
smtp_server=smtp.gmail.com
smtp_port=25
default_domain=localhost
auth_username=mygmaill@gmail.com
auth_password=*********
force_sender=mygmail@gmail.com
hostname=localhost
my email.php code:
<?php
//ini_set('localhost');
$to = "sommai@gmail.com";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: mygmail@gmail.com";
if(mail($to,$subject,$txt,$headers)){
echo "message sent";
} else {
echo "mail sent fail";
}
?>
it shows mail send in echo but never receive any mail.
Please guide me solve this.