sendmail from localhost is driving me crazy! [message #184801] |
Mon, 03 February 2014 09:03 |
shumit
Messages: 1 Registered: February 2014
Karma: 0
|
Junior Member |
|
|
I have followed the universally accepted methods for sending mail from gmail but I cannot yet send a single email. I am using wampserver.
My sendmail config is
smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=SSL
default_domain=localhost
error_logfile=error.log
auth_username=myaccount(at)gmail(dot)com
auth_password=pwd
hostname=localhost
Pretty standard.
My Php.ini file now contains the following
sendmail_path = "c:\wamp\sendmail\sendmail.exe -t -i"
And yet I cannot send a mail. I had this working before I moved my PC from XP to Windows 8 so I really don't know what is wrong.I have tried every combination of port and SSL, turned off firewalls. Nothing.
I enabled “ssl_module” module in Apache server
and
enabled “php_openssl” and “php_sockets” extensions for PHP compiler.
But nothing is coming through. My PHP code is pretty simple
$to = 'shumit(at)gmail(dot)com';
$subject = 'Testing sendmail.exe';
$message = 'Hi, you just received an email using sendmail!';
$headers = 'From: tttt(at)gmail(dot)com' . "\r\n" .
'Reply-To: tttt(at)gmail(dot)com' . "\r\n" .
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=iso-8859-1' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
if(mail($to, $subject, $message, $headers))
echo "Email sent. ";
else
echo "Email sending failed. ";
Any ideas?
thanks is advance
Shumit
|
|
|
|
Re: sendmail from localhost is driving me crazy! [message #184807 is a reply to message #184801] |
Mon, 03 February 2014 12:52 |
Ben Bacarisse
Messages: 82 Registered: November 2013
Karma: 0
|
Member |
|
|
shumit <shumit(at)eskatongardens(dot)com> writes:
> I have followed the universally accepted methods for sending mail from
> gmail but I cannot yet send a single email. I am using wampserver.
>
> My sendmail config is
>
> smtp_server=smtp.gmail.com
> smtp_port=465
> smtp_ssl=SSL
> default_domain=localhost
> error_logfile=error.log
>
> auth_username=myaccount(at)gmail(dot)com
> auth_password=pwd
> hostname=localhost
>
> Pretty standard.
This format is specific to the mail program and they all offer sendmail
compatibility so that name alone is not much help.
> My Php.ini file now contains the following
>
> sendmail_path = "c:\wamp\sendmail\sendmail.exe -t -i"
>
> And yet I cannot send a mail.
Separate the mail sending from PHP. Can you send a message using
sendmail on its own? If sending fails, there is likely to be some sort
of log file which will tell you more, but where that will be is
dependent on which mail program you are using.
<snip>
> I enabled
|
|
|