Page 1 of 1

utf-8 and email

Posted: Fri Feb 03, 2006 12:15 pm
by eyespark
Hi

I'm sending email with this code:

Code: Select all

<? $recipient = "$friend_mail";
$send_subject = "ma subject";
$message = "my message.\n";
		
$headers  = 'X-Mailer: PHP/' . phpversion() . "\r\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Return-Path: $sender_mail\r\n";
$headers .= "Reply-To: $sender_mail\r\n"; 
$headers .= "From: $sender_name <$sender_mail>\r\n"; 
$headers .= "Content-Type: text/plain; charset=utf-8\r\n\r\n";
$headers .= "Content-Transfer-Encoding: base64\r\n\r\n"; 

mail ($recipient, $send_subject, $message, $headers);
?>
My problem is that the first line in recieved mail body is: Content-Transfer-Encoding: base64.

Why? Is this normal?

Thanks

Posted: Fri Feb 03, 2006 12:41 pm
by josh
because you have a double linebreak after that header, which delimiters the end of the header section of the email

Posted: Fri Feb 03, 2006 12:52 pm
by eyespark
Hi

I just tried your solution (erased one linedreak) but it is stil the same.

Thanks

Posted: Fri Feb 03, 2006 12:58 pm
by eyespark
Aaaaaah, yes! Changed Content-Transfer-Encoding to 8bit and it works.

Now I have to figure out why email goes to junk mailbox. Any ideas?

Thanks