Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

email - PHP mail using 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Gmail's SMTP-server requires a very specific configuration.

From Gmail help:

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 ([email protected])
Password:     your Gmail password 

You can probably set these settings up in Pear::Mail or PHPMailer. Check out their documentation for more details.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...