How to Setup XAMPP SMTP Using Gmail

Februari 04, 2024 ・0 comments




To set up XAMPP SMTP using Gmail, you can follow the steps below:
1. Open the php.ini file in the C:\xampp\php directory.
2. Find the [mail function] section by pressing Ctrl + F.
3. Replace the SMTP configuration settings with the following values:
SMTP=smtp.gmail.com 
smtp_port=587 
sendmail_from = yourgmailid@gmail.com 
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
4. Save the changes to the php.ini file.
5. Open the sendmail.ini file in the C:\xampp\sendmail directory.
6. Replace the contents of the file with the following:
smtp_server=smtp.gmail.com 
smtp_port=587 
auth_username=yourgmailid@gmail.com 
auth_password=yourgmailpassword 
force_sender=yourgmailid@gmail.com
7. Save the changes to the sendmail.ini file.
8. Restart the Apache server in XAMPP.
9. Test the SMTP configuration by running a PHP script that sends an email.

Please note that you need to replace yourgmailid and yourgmailpassword with your actual Gmail account credentials. 

Posting Komentar

If you can't comment, try using Chrome instead.