i am using Xampp on windows 7 and i am trying to send a mail using php mail() function to my gmail. (without using libraries like Phpmailer)
i have tried using:
Mercury Mail - The script is not showing any errors and the mail() function actually returns true
Test Mail Server Tool - same issue as mercury mail
Fake Send mail - getting a "Connect timed out" error.
These are my settings for Fake Send Mail :
sendmail.ini
smtp_server=smtp.gmail.com
smtp_port=587 (tried using 465)
error_logfile=error.log
debug_logfile=debug.log
[email protected]
auth_password=pass
php.ini
sendmail_path = "\"E:\xampp\sendmail\sendmail.exe\" -t" has been commented out
This is my code:
<?php
$to = '[email protected]';
$subject = 'the the';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
This is result of telnet smtp.gmail.com 587 :
220 mx.google.com ESMTP sb3sm19649093pac.14 - gsmtp
451 4.4.2 Timeout - closing connection. sb3sm19649093pac.14 - gsmtp
Connection to host lost.
i have gone through similar questions in this forum but it's still not working for me.
What is it that i am missing here and could you provide me the links for any other tools that i should try? Thanks..