/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function sendHtmlEmail($recipient, $subject, $html) { // Need PEAR in include path with installed: Mail, Net_Smtp 'From' => 'whateveremail', 'Reply-To' => 'whateveremail', 'Cc' => 'whateveremail', 'MIME-Version' => '1.0', 'Content-Type' => 'text/html; charset=UTF-8', 'To' => $recipient, 'Subject' => $subject, ); 'host' => 'smtp.server.whatever', 'port' => 25, 'auth' => true, 'username' => , 'password' => ) ); $mail = $smtp->send($recipient, $headers, $html); if (PEAR::isError($mail)) { return false; } return true; }
Comments
