Hey All,
Im trying to write a function that sends a multipart email .... but when i run it, it just returns an empty email.
Could someone have a quick look and let me know where im going wrong.
function Welcome($user, $email, $pass, $activation_key){
$userurl = str_replace(" ", "%20", $user);
$random_hash = "s1_" . md5(date('r', time()));
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "X-Mailer: My Mailer" . "\r\n";
$headers .= "Reply-to: email@email.com <email@email.com>" . "\r\n";
$headers .= "From: email@email.com <email@email.com>" . "\r\n";
$headers .= "Content-type: multipart/alternative; boundary=\"$random_hash\"";
$subject = "This is the subject";
$body = "
--$random_hash
Content-type: text/plain; charset=\"iso-8859-1\"
Content-Transfer-Encoding: 7bit
Text email goes here
--$random_hash
Content-Type: text/html; charset=\"iso-8859-1\"
Content-Transfer-Encoding: 7bit
<html>
<head>
<title>Title</title>
</head>
<body bgcolor=\"#FFFFFF\">
<p>Test</p>
</body>
</html>
--$random_hash--
";
return mail($email,$subject,$body,$headers);
}