Page 1 of 1

Emails appear as an attachment in GMail

Posted: Fri Feb 02, 2007 4:27 am
by amir
Hi! Here is a function that is used to send out emails:

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);
     }
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!

Posted: Fri Feb 02, 2007 7:02 am
by dude81

Code: Select all

print $content_type
and let us know

Posted: Fri Feb 02, 2007 10:25 am
by amir
text