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.exeplus the others.dllwrong? - Is the entries in
php.ini,sendmail.ini,sendmail.phpwrong?