| Sending mail with PHP using SMTP-auth | Article ID:394 |
To protect 3Essentials network, servers, and customers from spamming, 3Essentials requires the use of SMTP-auth for all methods of sending email. The basic PHP Mail function does not support SMTP-auth, therefore cannot be used. To find out more about SMTP-auth and enabling smtp-auth on PHP based open sourced solutions (like phpBB, OScommerce, etc), see this article: What is SMTP-AUTH? To write your own PHP code to send email using SMTP-auth, we've made the PHP PEAR Mail package available for usage (which does support smtp-auth). The following PHP code sample shows how to use this feature in your PHP code to send an email:
Be sure to change the applicable values (from, to, subject, body, username, password) to your own.This code will work with either PHP 4 or PHP 5. Important note: Please do not name the file as Mail.php as we're giving reference to the Mail.php in the code which is located in the server. Since this is essential for the code to work, you can name the file as mailer.php or mailsend.php for this code. IMPORTANT: If you're on WEB20(NOT on any other server), then you may need to add a line in the php.ini file found under your HTTPDOCS if you happen to get this error: Warning: main(Mail.php) [function.main]: failed to open stream: No such file or directory in E:\inetpub\vhosts\domainname\httpdocs\filename.php on line 2 The line to be added in php.ini is: include_path=".;F:\Program Files\SWsoft\Plesk\Additional\Php\pear;./includes;./pear" |
|
| Downloads associated with this article: | |
| No downloads associated with this article | |