使用Gmail的PHP邮件 [英] PHP mail using Gmail
本文介绍了使用Gmail的PHP邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的PHP webapp中,我希望在发生某些错误时通过电子邮件通知。我想使用我的Gmail帐户发送这些。如何做到这一点?
In my PHP webapp, 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屋!
查看全文