简体   繁体   English

如何配置XAMPP将邮件从localhost发送到gmail?

[英]How to configure XAMPP to send mail from localhost to gmail?

I am trying to send mail from localhost. 我正在尝试从localhost发送邮件。

I changed files php.ini and sendmail.ini and still not working. 我更改了文件php.ini和sendmail.ini但仍然无法正常工作。 I am also turned on "Less secure app access" in Gmail account security 我还在Gmail帐户安全性中启用了“安全性较低的应用访问权限”

php.ini php.ini中

SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = my-email@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
mail.add_x_header=Off

sendmail.ini sendmail.ini

smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=my-email@gmail.com
auth_password=my-email-password
force_sender=my-email@gmail.com

You also need to allow less secure apps from your google account. 您还需要允许来自Google帐户的安全性较低的应用。

  1. Go to your Google Account. 转到您的Google帐户。
  2. On the left navigation panel, click Security. 在左侧导航面板中,单击“安全性”。
  3. On the bottom of the page, in the Less secure app access panel, click Turn on access. 在页面底部的“不太安全的应用程序访问”面板中,单击“打开访问权限”。

https://support.google.com/accounts/answer/6010255?hl=en https://support.google.com/accounts/answer/6010255?hl=en

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM