HI,
I had been trying to send a html email from the folowing script that i
took from zend site and modified. Its working fine, but it sends some
garbage in the end of the mail.
I had posted this msg on the zend and other forums and also read this
forum with some similar msg. They talked about encoding I think there
is some problem in the encoding. I will be very thankful to someone
who can currect the script. Remember currect, I dont want to know what
am i Doing wrong this is because I am so tierd of trying them. Please
I will be thankful, I understand that i should learn where am I going
wrong but I tried all suggestions may be I am not doing it the right
way. I will be thankful if someone can currect it or mail me the
similar script that works fine to sm***********@hotpop.com.
Regards
Jaunty
<?
$headers = "From: we*******@myhost.net\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$boundary = uniqid("HTMLDEMO");
$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("This is the plain text
version!"));
$headers .= "--$boundary\r\n" . "Content-Type: text/html;
charset=ISO-8859-1\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n";
$name = stripslashes($HTTP_POST_VARS['name']);
$email = stripslashes($HTTP_POST_VARS['email']);
$msg = "<b>Name:</b> " .
$name . "\nEMail: " . $email;
$headers .= chunk_split(base64_encode("$msg"));
$sent = @mail('Mr. Jaunty<me@myemail.net>', 'Msg From My Website' ,
$msg , $headers);
if($sent == true) {
header('Location: send.htm');
}
if($sent == false) {
header('Location: notsend.htm');
}
?>