by
41 7
-1
6
298k
7
Top 1% !
Popular
Pearl of Wisdom
Easy-to-find
Specified
OpenSource
Popularity: 3812nd place
Created
Modified Nov 3, 2014
LanguageText
LicenseMIT_X11

Sending email via AuthMailer service using PHP

Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/215027/Sending-email-via-AuthMailer-service-usi?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
//this code sends emails via AuthMailer service (www.authmailer.com) <? //install the Mail, Net_Socket and Net_SMTP with PEAR require_once "Mail.php"; //mail headers and body $from = "Me"; $to = "You"; $subject = "Subject"; $body = "Lorem Ipsum..."; //server configuration, edit with your account details $host = "authmailer.com"; $port = "587"; $user = "user"; $pass = "pass"; $headers = array('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array('host' => $host, 'auth' => true, 'username' => $user, 'password' => $pass)); //sending email $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { //something went wrong echo($mail->getMessage()); } else { //OK echo("Message was sent!"); } ?>
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus