How to configure WAMP (localhost) to send email using Gmail?(如何配置 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:
- PEAR::Mail
- phpMailer
- NetteMail
它们都支持 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.
其他资源:
- 如何使用 SMTP 身份验证从 PHP 脚本发送电子邮件(使用
PEAR::Mail
) - 使用 PHP 发送电子邮件Gmail(使用 phpMailer)
- 邮寄使用
NetteMail
- 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 发送电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何配置 WAMP (localhost) 以使用 Gmail 发送电子邮件?


基础教程推荐
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何替换eregi() 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01