FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » sendmail from localhost is driving me crazy!
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
sendmail from localhost is driving me crazy! [message #184801] Mon, 03 February 2014 09:03 Go to next message
shumit is currently offline  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 #184806 is a reply to message #184801] Mon, 03 February 2014 12:49 Go to previous messageGo to next message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
On Mon, 03 Feb 2014 03:03:50 -0600, shumit wrote:

> I have followed the universally accepted methods for sending mail from
> gmail but I cannot yet send a single email. I am using wampserver.

Check your error logs. Do they offer any hints or clues?

--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
Re: sendmail from localhost is driving me crazy! [message #184807 is a reply to message #184801] Mon, 03 February 2014 12:52 Go to previous message
Ben Bacarisse is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: RE: Seeeking Windows PHP IDE for USB Stick
Next Topic: login validation from 2 tables in same database
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 01:50:05 GMT 2024

Total time taken to generate the page: 0.03196 seconds