Apr 2009 15
You have to have PEAR installed. You can get more information at http://pear.php.net.
<?php include('Mail.php'); include('Mail/mime.php'); $text = 'Hello,\nHow are you doing?'; $html = 'Hello, How are you doing?'; $smtpinfo["host"] = "smtp.domain.com"; $smtpinfo["port"] = "25"; $smtpinfo["auth"] = true; $smtpinfo["username"] = "SMTP USERNAME"; $smtpinfo["password"] = "SMTP PASSWORD"; $recipients = "recipient@domain.com"; $headers["From"] = "From Name "; $headers["To"] = "recipient@domain.com"; $headers["Subject"] = "Email Subject"; $mime = new Mail_mime(); $mime->setTXTBody($text); $mime->setHTMLBody($html); $body = $mime->get(); $headers = $mime->headers($headers); $mail =& Mail::factory('smtp', $smtpinfo); $mail->send($recipients, $headers, $body); if(PEAR::isError($mail)){ echo(" There was an error: " . $mail->getMessage() . " "); }else { echo(" Message Sent To $to "); } ?>








Worked like a charm. Thanks!