I have spent all the morning searching this on internet trying to find a solution about this.
I have installed wamp server on Windows 8.1 and i'm trying to send some mails with sendmail (http://glob.com.au/sendmail/) and my gmail account
When i configure sendmail to use port no 465 I always get this error: Socket Error # 10060Connection timed out
If i try to use port no 587 i get this line on error log: Connection Closed Gracefully. But no email is sent.
This is my sendmail.ini file
[sendmail]
smtp_server=smtp.gmail.com
;I tried both: 587, 465
smtp_port=587
; I tried: "blank, auto ssl, tls, none"
smtp_ssl=
error_logfile=error.log
debug_logfile=debug.log
[email protected]
auth_password=mypass
hostname=localhost
And this is php.ini file
[mail function]
smtp_port = 465
sendmail_path="C:wampsendmailsendmail.exe -t"
mail.add_x_header = On
ssl_module is active on apache, and php uses php_open_ssl and php_socket extension.
Also i tried to use stunnel whitout any success
EDIT 27/01/2014
I set smtp_port = 465 and smtp_ssl=ssl on sendmail.ini. Also, I set that sendmail.exe has to run as a Windows XP SP3 programs. After doing that, when I run sendmail.exe on windows console, it sends the email correctly. However, when wamp tries to send mails i get this error on sendmail's error logs.: Socket Error # 10060Connection timed out.
This is the code I'm using to test sendmail:
<?php
$email = "[email protected]";
$to = "[email protected]";
$subject = "Hi!";
$body = "Hi,How are you?";
$headers = 'From: ' .$email . "
".'Reply-To: ' . $email. "
".'X-Mailer: PHP/' . phpversion();
if (mail($to, $subject, $body, $headers)) echo("<p>Email successfully sent</p>");
else echo("<p>Email delivery failed</p>");
?>
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…