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?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
You could use PEAR's mail function with Gmail's SMTP Server
Note that when sending e-mail using Gmail's SMTP server, it will look like it came from your Gmail address, despite what you value is for $from.
(following code taken from About.com Programming Tips )
Gmail's SMTP-server requires a very specific configuration.
From Gmail help:
You can probably set these settings up in Pear::Mail or PHPMailer. Check out their documentation for more details.