I have been trying to send email using PHP script and XAMPP Lite. The PHP script itself is not a biggies but the default XAMPP configuration doesnt allow me to send out the email.
My objective is to use Gmail as my SMTP (rather than localhost). After some digging and try and error.. Here is my solution :
Edit your php.ini (xamppphpphp.ini). Search for [mail function] and change these parameters accordingly :
SMTP = smtp.gmail.com
smtp_port = 587
sendmail_from = [your_gmail_username]@gmail.com
Note: This gmail account will be used to send the email
sendmail_path = “â€D:xamppsendmailsendmail.exe†-tâ€
Note: I did install my xampp at D:xampp
1. Edit your sendmail.ini (xamppsendmailsendmail.ini)
Comment the “Mercury”and “A free mail service example” contents as shown below:
# Mercury
#account Mercury
#host localhost
#from postmaster@localhost
#auth off
# A freemail service example
#account Hotmail
#tls on
#tls_certcheck off
#host smtp.live.com
#from [exampleuser]@hotmail.com
#auth on
#user [exampleuser]@hotmail.com
#password [examplepassword]
2. Add the account through which you want to send your mails. In my example I have configured the Gmail account as shown below:
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from [your_gmail_username]@gmail.com
auth on
user [your_gmail_username]@gmail.com
password [your_gmail_password]port 587
3. Set the default account to Gmail as shown below:
account default : Gmail
Many thanks to this link . His original post point me to the right direction. The only missing piece is port number in sendmail.ini where gmail no longer use port 25 as smtp port but 587. Hope this help.
Comments
Tags: gmail, gmail SMTP, mail configuration, mail issues, mail sending issues, php, php mail sending, Send Email Using Gmail as my SMTP from XAMPP (PHP), SMTP, XAMPP
Other Interesting Links :
https://drupal.org/node/161975
https://drupal.org/node/166831
https://drupal.org/node/75537
http://myownhomeserver.com/2012/12/how-to-create-multiple-websites-using-apache-xampp/
http://trueacu.com/Xampp_Lite_Install
sendmail_path = “â€D:xamppsendmailsendmail.exe†-tâ€
Hello. And Bye.