To configure the XAMPP server to send mail from localhost, we need to modify two files sendmail.ini and php.ini. Open the xampp folder. Named "sendmail.ini" is present in sendmail
and "php.ini" is present in php
file in xampp
folder. Step 1:
Step 2 Note.
- Go to C: / xampp / sendmail:open the sendmail.ini file in notepad or any text editor and make the following changes.
change smtp_server = mail.yourdomain.com to smtp_server = smtp.gmail.com change smtp_port to smtp_port = 587 change smtp_ssl = auto to smtp_ssl = tls
uncomment; error_logfile = error.log to error_logfile = error.log uncomment; debug_logfile = debug.log to debug_logfile = debug.log write your gmail id in auth_username: auth_username = **** *@gmail.com write your gmail assword in auth_password: auth_password = *****
write your gmail id in force_sender: *****@gmail.com change hostname to hostname = localhost
The procedure is shown here for gmail, but it can be extended to other emails by changing the smtp server and port number. When using gmail, take care to enable the setting to allow access to the less secure web application.
SO 1 data error