使用Gmail的PHP邮件

Din*_*nah 11 php email gmail

在我的PHP Web应用程序中,我希望在发生某些错误时通过电子邮件收到通知.我想使用我的Gmail帐户发送这些内容.怎么可以这样做?

Jav*_*che 9

Gmail的SMTP服务器需要非常具体的配置.

来自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 
Run Code Online (Sandbox Code Playgroud)

您可以在Pear :: MailPHPMailer中设置这些设置.查看他们的文档了解更多详情.