Blank Multipart email

后端 未结 3 757
野性不改
野性不改 2021-01-20 09:11

I\'m using PHP to send out a multipart/mixed message (plain text, html and attachments). However, whilst it works for most accounts, Yahoo, GMail and Sky seem to show blank

3条回答
  •  盖世英雄少女心
    2021-01-20 09:33

    Please verify whether your code is look like the following because the following code is working fine for me.

    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n";
    $headers .= "This is a multi-part message in MIME format.\r\n";
    $headers .= "--".$uid."\r\n";
    $headers .= "Content-type:text/html; charset=iso-8859-1\r\n";
    $headers .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
    $headers .= $msg."\r\n\r\n";    
    $headers .= "--".$uid."\r\n";
    $headers .= "Content-Type:application/html; name=\"".$filename."\" \r\n"; // use different content types here
    $headers .= "Content-Transfer-Encoding: base64\r\n";
    $headers .= "Content-Disposition: attachment; filename=\"".$filename."\"\r\n\r\n";
    $headers .= $content."\r\n\r\n";
    $headers .= "--".$uid."--";
    

提交回复
热议问题