使用 Gmail 的 PHP 邮件 [英] PHP mail using Gmail
本文介绍了使用 Gmail 的 PHP 邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的 PHP Web 应用程序中,我希望在发生某些错误时通过电子邮件收到通知.我想使用我的 Gmail 帐户发送这些邮件.这怎么可能?
In my PHP web app, I want to be notified via email whenever certain errors occur. I'd like to use my Gmail account for sending these. How could this be done?
推荐答案
Gmail 的 SMTP 服务器需要非常具体的配置.
Gmail's SMTP-server requires a very specific configuration.
来自 Gmail 帮助:
Outgoing Mail (SMTP) Server (requires TLS)
- smtp.gmail.com
- Use Authentication: Yes
- Use STARTTLS: Yes (some clients call this SSL)
- Port: 465 or 587
Account Name: your full email address (including @gmail.com)
Email Address: your email address (username@gmail.com)
Password: your Gmail password
您可能可以在 Pear::Mail 或 PHPMailer.查看他们的文档了解更多详情.
You can probably set these settings up in Pear::Mail or PHPMailer. Check out their documentation for more details.
这篇关于使用 Gmail 的 PHP 邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文