All pastes #988651 Raw Edit

sloc

public php v1 · immutable
#988651 ·published 2008-04-17 19:44 UTC
rendered paste body
function sendHTMLemail($HTML,$from,$to,$subject) {    $headers = "From: $from\r\n";    $headers .= "MIME-Version: 1.0\r\n";    $boundary = uniqid("HTMLEMAIL");      $headers .= "Content-Type: multipart/alternative;".                "boundary = $boundary\r\n\r\n";    $headers .= "This is a MIME encoded message.\r\n\r\n";    $headers .= "--$boundary\r\n".                "Content-Type: text/plain; charset=ISO-8859-1\r\n".                "Content-Transfer-Encoding: base64\r\n\r\n";                 $headers .= chunk_split(base64_encode(strip_tags($HTML)));    $headers .= "--$boundary\r\n".                "Content-Type: text/html; charset=ISO-8859-1\r\n".                "Content-Transfer-Encoding: base64\r\n\r\n";                  $headers .= chunk_split(base64_encode($HTML));    mail($to,$subject,"",$headers);   }