如何配置 WAMP (localhost) 以使用 Gmail 发送电子邮件? [英] How to configure WAMP (localhost) to send email using Gmail?

查看:32
本文介绍了如何配置 WAMP (localhost) 以使用 Gmail 发送电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用本地主机中的 mail() 函数.我安装了 WAMP 和一个 Gmail 帐户.我知道 Gmail 的 SMTP 是 smtp.gmail.com,端口是 465 (来自 gmail 的更多信息).我需要在 WAMP 中配置什么才能使用 mail() 函数?

I want to use the mail() function from my localhost. I have WAMP installed and a Gmail account. I know that the SMTP for Gmail is smtp.gmail.com and the port is 465 (more info from gmail). What I need to configure in WAMP so I can use the mail() function?

谢谢!!

推荐答案

Gmail 服务器使用 SSL 或 TLS 下的 SMTP 身份验证.我认为在这种情况下无法使用 mail() 功能,因此您可能需要检查以下替代方案:

Gmail servers use SMTP Authentication under SSL or TLS. I think that there is no way to use the mail() function under that circumstances, so you might want to check these alternatives:

它们都支持 SSL 下的 SMTP 身份验证.

They all support SMTP auth under SSL.

您需要在 php.ini 中启用 php_openssl 扩展.

You'll need to enable the php_openssl extension in your php.ini.

其他资源:

  • How to Send Email from a PHP Script Using SMTP Authentication (using PEAR::Mail)
  • Send email using PHP with Gmail (using phpMailer)
  • Mailing using NetteMail

这篇关于如何配置 WAMP (localhost) 以使用 Gmail 发送电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆