繁体   English   中英

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

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

我正在尝试从localhost发送邮件。

我更改了文件php.ini和sendmail.ini但仍然无法正常工作。 我还在Gmail帐户安全性中启用了“安全性较低的应用访问权限”

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

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

您还需要允许来自Google帐户的安全性较低的应用。

  1. 转到您的Google帐户。
  2. 在左侧导航面板中,单击“安全性”。
  3. 在页面底部的“不太安全的应用程序访问”面板中,单击“打开访问权限”。

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

暂无
暂无

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

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