AddAttachment PHPmailer,电子邮件发送空白

时间:2017-05-19 14:43:49

标签: phpmailer attachment roundcube

让我解决我的问题,希望有人可以帮忙。

我有一个使用phpmailler发送我的发票的系统,所以当我发送一封带有AddAttachment的电子邮件时,我收到的电子邮件没有显示它的正文,当我发送没有AddAttachment的电子邮件时,我收到了正常的邮件。

让我告诉你:

使用AddAttachment的电子邮件中的代码

Return-path: <financeiro@ctinformatica.com.br>
Envelope-to: financeiro@codetek.com.br
Delivery-date: Fri, 19 May 2017 11:12:00 -0300
Received: from server01.heytec.com.br ([162.144.222.173]:36833 helo=www.heytec.com.br)
    by server01.heytec.com.br with esmtpa (Exim 4.85)
    (envelope-from <financeiro@ctinformatica.com.br>)
    id 1dBidM-0007MI-GB
    for financeiro@codetek.com.br; Fri, 19 May 2017 11:12:00 -0300
Date: Fri, 19 May 2017 11:12:00 -0300
To: financeiro@codetek.com.br
From: CT Informatica <financeiro@ctinformatica.com.br>
Subject: Sua Fatura Chegou!
Message-ID: <7c04d9e16a4d9a705b436f34c72b64ca@www.heytec.com.br>
X-Priority: 3
X-Mailer: PHPMailer [version 1.73]
MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1From: CT Informatica <financeiro@ctinformatica.com.br>
Reply-To: financeiro@ctinformatica.com.br
MIME-Version: 1.0
Content-Type: multipart/mixed;
    boundary="b1_7c04d9e16a4d9a705b436f34c72b64ca"
X-From-Rewrite: unmodified, already matched

--b1_7c04d9e16a4d9a705b436f34c72b64ca
Content-Type: text/html; charset = "iso-8859-1"
Content-Transfer-Encoding: 8bit

<table style="border: 1px solid #33679a; font-family: Calibri; font-size: 16px; color: #1b1a17; height: 582px;" width="812" cellspacing="0" cellpadding="10" align="center">
<tbody>
<tr><td>MY SIMPLE HTML</td></tr>
</tbody>
</table>

--b1_7c04d9e16a4d9a705b436f34c72b64ca
Content-Type: application/octet-stream; name="boleto-1253172.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="boleto-1253172.pdf"

BLA BLA BLA PDF Encoding TEXT FROM PDF


--b1_7c04d9e16a4d9a705b436f34c72b64ca--

没有AddAttachment的代码

Return-path: <financeiro@ctinformatica.com.br>
Envelope-to: financeiro@codetek.com.br
Delivery-date: Fri, 19 May 2017 11:33:54 -0300
Received: from server01.heytec.com.br ([162.144.222.173]:37764 helo=www.heytec.com.br)
    by server01.heytec.com.br with esmtpa (Exim 4.85)
    (envelope-from <financeiro@ctinformatica.com.br>)
    id 1dBiyX-0003Fd-Qd
    for financeiro@codetek.com.br; Fri, 19 May 2017 11:33:53 -0300
Date: Fri, 19 May 2017 11:33:53 -0300
To: financeiro@codetek.com.br
From: CT Informatica <financeiro@ctinformatica.com.br>
Subject: Sua Fatura Chegou!
Message-ID: <659d0adfa80994b156e9803bb3f84884@www.heytec.com.br>
X-Priority: 3
X-Mailer: PHPMailer [version 1.73]
MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1From: CT Informatica <financeiro@ctinformatica.com.br>
Reply-To: financeiro@ctinformatica.com.br
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset="iso-8859-1"
X-From-Rewrite: unmodified, already matched

<table style="border: 1px solid #33679a; font-family: Calibri; font-size: 16px; color: #1b1a17; height: 582px;" width="812" cellspacing="0" cellpadding="10" align="center">
<tbody>
<tr><td>MY SIMPLE HTML</td></tr>
</tbody>
</table>

当我在我的代码中添加AddAttachment时,我有一个问题。 当我查看收到的电子邮件时,我收到了enter image description here

什么都没有,甚至是我看不到的附件。

检查我的发送代码

$headers = "MIME-Version: 1.0\n";
                $headers .= "Content-type: text/html; charset=iso-8859-1";
                $headers .= "From: $ln_letter[car_remetente] <$ln_letter[car_fromemail]>\n";     
                $headers .= "Reply-To: $ln_letter[car_fromemail]\n";

                $mail = new PHPMailer();
                $mail->SetLanguage("br", "language/");


                $mail->From = $ln_letter[car_fromemail]; 
                $mail->FromName = $ln_letter[car_remetente];
                $mail->Host = "mail.heytec.com.br";
                $mail->Mailer = "smtp";
                $mail->AddAddress($destinatario);
                $mail->AddCustomHeader($headers);


                $mail->Subject = $subject;
                $mail->isHTML(true);
                $mail->Body = $body; 

                $mail->SMTPAuth = true;
                $mail->Username =  $ln_letter[car_fromemail];
                $mail->Password =  $senha_email;

                $mail->AddAttachment($arrayanexos[$i]);

                $mail->Send()

我不知道这是什么问题=( 抱歉英语。

0 个答案:

没有答案
相关问题