email sent by php script has empty content in Thunderbird

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rukkie

    #1

    email sent by php script has empty content in Thunderbird

    Hi,

    I have here some strange behaviour, when sending a mail out from my
    php script. The mail is perfectly readable in MS Outlook, but has an
    empty body when reading the mail with Thunderbird (version 1.5.0.12).
    Using "View>Messa ge source", one can see the body ...

    The script used is :

    *************** *************** *************** *************** *************** ********
    $to="xxxxxxxx@x xxxxxx";

    $link="http://www.yyy.zzz/test.html";

    $from="xxxxxxxx @xxxxxxx";
    $subject= "Test" ;
    $message = "Test Test." ."\n";
    $message .=" " ."\n";

    $message .="Link Test" .$link."\n";
    $message .=" " ."\n";
    $message .=" " ."\n";

    $headers = "From: " . $from . "\n" ;

    // $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "MIME-Version: 1.0\n";
    // $headers .= "Content-type: multipart/mixed; charset=iso-8859-1\r
    \n";
    $headers .= "Content-type: multipart/mixed; charset=iso-8859-1\n";


    mail($to, $subject, $message, $headers);
    *************** *************** *************** *************** *************** *************** ***
    Can it be that it has something to do with the MIME or content-type ?
    Or is there something wrong in the Thunderbird settings ?

    Any information is more than welcome ...

  • C.

    #2
    Re: email sent by php script has empty content in Thunderbird

    On 22 Jun, 11:01, rukkie <ruk...@belgaco m.netwrote:
    Hi,
    >
    I have here some strange behaviour, when sending a mail out from my
    php script. The mail is perfectly readable in MS Outlook, but has an
    empty body when reading the mail with Thunderbird (version 1.5.0.12).
    Using "View>Messa ge source", one can see the body ...
    >
    <snip>
    Can it be that it has something to do with the MIME or content-type ?
    Or is there something wrong in the Thunderbird settings ?
    >
    Any information is more than welcome ...
    I think you'll probably find its something wrong with MS Outlook -
    you're not delimiting the sections of the body nor using an inline
    disposition. Try sending an Email with attachments FROM thunderbird
    and view the source.

    C.

    Comment

    • shimmyshack

      #3
      Re: email sent by php script has empty content in Thunderbird

      On Jun 22, 11:01 am, rukkie <ruk...@belgaco m.netwrote:
      Hi,
      >
      I have here some strange behaviour, when sending a mail out from my
      php script. The mail is perfectly readable in MS Outlook, but has an
      empty body when reading the mail with Thunderbird (version 1.5.0.12).
      Using "View>Messa ge source", one can see the body ...
      >
      The script used is :
      >
      *************** *************** *************** *************** *************** ********
      $to="xxxxxxxx@x xxxxxx";
      >
      $link="http://www.yyy.zzz/test.html";
      >
      $from="xxxxxxxx @xxxxxxx";
      $subject= "Test" ;
      $message = "Test Test." ."\n";
      $message .=" " ."\n";
      >
      $message .="Link Test" .$link."\n";
      $message .=" " ."\n";
      $message .=" " ."\n";
      >
      $headers = "From: " . $from . "\n" ;
      >
      // $headers .= "MIME-Version: 1.0\r\n";
      $headers .= "MIME-Version: 1.0\n";
      // $headers .= "Content-type: multipart/mixed; charset=iso-8859-1\r
      \n";
      $headers .= "Content-type: multipart/mixed; charset=iso-8859-1\n";
      >
      mail($to, $subject, $message, $headers);
      *************** *************** *************** *************** *************** *************** ***
      Can it be that it has something to do with the MIME or content-type ?
      Or is there something wrong in the Thunderbird settings ?
      >
      Any information is more than welcome ...
      Outlook is probably ignoring your headers, and rendering a default, TB
      does tend to trip up on oddly formatted emails.
      Are you sending attachments, is there more code than you've posted?
      Try removing the mime and content-type, leaving only the From or
      decide if you are sending plain text, and use that instead.
      see http://en.wikipedia.org/wiki/MIME#Mixed for more.
      Have you considered using the class phpmailer or another prewritten
      (make sure its modern and has a good rep for security) class to
      prepare and send mail of different kinds?

      Comment

      • rukkie

        #4
        Re: email sent by php script has empty content in Thunderbird

        Thanks,

        removing the MIME and content-type is the solution ...


        Comment

        Working...