i am trying to make my wamp server supportable for sending emails offline without using any hosting website. i just try to do couple of ways to implement it but can't. after long research i find a way but as per follow instruction but still it cannot work.
simply i just download send-mail.zip and extract on to a folder in F:\wamp\sendmail\
sendmail.ini what i configure in it
- smtp_server=smtp.gmail.com
- smtp_port=465
- smtp_ssl=ssl
- default_domain=localhost
- error_logfile=error.log
- debug_logfile=debug.log
- auth_username=*****@gmail.com
- auth_password=********
after enabling POP/IMAP from gmail account
php.ini what i configure in it
- ;SMTP =
- ;smtp_port = 25
- ;sendmail_from = snavjot969@yahoo.com
- sendmail_path ="F:\wamp\sendmail\sendmail.exe -t -i"
- ;mail.force_extra_parameters =
and the php code that i used to send email on localhost:
if(isset($_POST['submit']))
{
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$comment = $_POST['comment'];
$to = "ns949405@gmail.com,snavjot969@yahoo.com";
$header = "from: $name<$email>";
$message = "Name:$name \n\n
email:$email \n\n
subject:$subject \n\n\
message:$comment";
if(mail($to,$subject,$message,$header))
{
echo "email sent";
}
else
{
echo "error";
}
}
when i press submit button it show error. any help is appreciated. thank-you in advance.