0

A year ago I tried to enable sending email from WAMP as localhost and failed. I just made another concerted effort but again failed. This is what I did and hope someone can give me a helping hand.

Since WAMP does not come with sendmail.exe, a folder c:\wamp\sendmail was created and the following files as shown in DIR were copied into it:

Directory of c:\WAMP\sendmail
14-01-11  03:44 PM         1,112,064 libeay32.dll
18-06-11  01:10 AM           932,864 sendmail.exe
04-04-14  10:45 PM             2,123 sendmail.ini
14-01-11  03:44 PM           275,968 ssleay32.dll

The sendmail.ini in this folder is set as follows, the key lines are 5 (smtp_server, smtp_port, default_domain, auth_username and auth_password):

smtp_server=smtp.gmail.com
; smtp port (normally 25)
smtp_port=587
smtp_ssl=auto

; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify

;default_domain=localhost

; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging

error_logfile=error.log

; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging

;debug_logfile=debug.log

; if your smtp server requires authentication, modify the following two lines

auth_username=mynamegmail.com
auth_password=mypassword

In php.ini of c:\WAMP\bin\php\php5.4.3, php.ini, ONE line was altered, namely sendmail_path ="\"c:\Wamp\sendmail\sendmail.exe\" -t".

Next a sendmail.php file is created in C:\wamp\www with the following content:

<?php
mail('receipient@yahoo.com','sample mail','sample content','From: sender@gmail.com');
?>

From the web browswer with localhost running, `sendmail.phpv was run but the mail did not go through.

  • Why did the localhost not send the mail as instructed in the sendmail.php?
  • Any thing missing or wrong?
  • Is the sendmail.exe plus the others .dll wrong?
  • Is the entries in php.ini, sendmail.ini, sendmail.php wrong?
AnFi
  • 10,493
  • 3
  • 23
  • 47
  • You're using the wrong SMTP port as given on GMail FAQ: [If you tried configuring your SMTP server on port 465 (with SSL)](https://support.google.com/mail/answer/78775?hl=en). [Also shouldn't those changes be made to the `sendmail.ini` file?](http://stackoverflow.com/a/19134713/342740) – Prix Apr 04 '14 at 23:50
  • Sverri Thanks, actually tried both ports 25 & 465 but not working. All problems as set out in GMail setting extra already checked. Telnet to smtp.gmail.com 465 goes through, ie blank command prompt, no message. Using VB5 CDO mail can be sent. Really scratching head for months on this. – user2782291 Apr 05 '14 at 08:36

1 Answers1

0

sendmail.ini

[sendmail]

smtp_server=smtp.gmail.com

smtp_port=465

smtp_ssl=ssl

error_logfile=error.log

debug_logfile=debug.log

auth_username=[email]@gmail.com

auth_password=[email password]

pop3_server=

pop3_username=

pop3_password=

force_sender=[email]@gmail.com

force_recipient= hostname=smtp.gmail.com

php.ini

[mail function]

SMTP = smtp.gmail.com

smtp_port = 465

sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

mail.add_x_header=Off

Karthiga
  • 859
  • 2
  • 17
  • 33