How to Setup XAMPP SMTP Using Gmail
Februari 04, 2024 ・0 comments ・Categories: application email server smtp ssl tips tutorial windows xampp
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:
5. Open the sendmail.ini file in the C:\xampp\sendmail directory.
6. Replace the contents of the file with the following:
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.
- Also, make sure that you have enabled Less secure app access in your Gmail account settings if you are using a personal Gmail account1
- If you are using a G Suite account, you may need to contact your administrator to enable SMTP relay2
I hope this helps you set up XAMPP SMTP using Gmail. Let me know if you have any further questions or concerns. 😊
Posting Komentar