Emails appear as an attachment in GMail
Posted: Fri Feb 02, 2007 4:27 am
Hi! Here is a function that is used to send out emails:
When a recipient has a gmail account, he receives a text of an email not as inline text, but as an attachment. To view the email he needs to download the attachment and open it in a text editor. The users check their emails through the web. What is wrong with the function and how I can fix it
Thank you!
Code: Select all
function send_email($message, $subject, $from_name, $from_email, $to_name, $to_email, $content_type="text"){
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: $content_type;\r\n";
$headers .= "From: \"".$from_name."\" <".$from_email.">\n";
$headers .= "Return-Path: \"".$from_name."\" <".$from_email.">\n";
$to = "\"".$to_name."\" <".$to_email.">";
mail($to, $subject, "$message", $headers);
}Thank you!