【问题标题】:phpmailer not handling Iphone subject line in emailsphpmailer 未处理电子邮件中的 Iphone 主题行
【发布时间】:2021-04-06 19:51:37
【问题描述】:

我正在使用以下脚本向我们的网站用户发送电子邮件:

function mailerExpressBlueHost(array $mailInputs){   

    require_once '../../includes/phpmailer/PHPMailerAutoload.php';  

    $mail = new PHPMailer();
    $mail->IsMail();   
    $mail->SetFrom('swag@sustainablewestonma.org');
    $mail->addAddress($mailInputs['addAddress']);   // use for production;
    $mail->AddBCC("swag@sustainablewestonma.org"); // set BCC: counts as part of the 500 limit;        
    $mail->AddEmbeddedImage("../images/newswagimageSmall.jpg", "swag-logo");    
    $mail->Subject = $mailInputs['subject'] ;
    $mail->Body    = $mailInputs['body'];
    $mail->IsHTML(true);
    $mail->ContentType="text/HTML";    

    if(!$mail->send()) {             
        $msg = 'Message could not be sent.' . 'Mailer Error: ' . $mail->ErrorInfo;
    }else{
        $msg = 'Message has been sent';
    }

    $mail->ClearAddresses(); 
    return $msg;   

}

在 ms Outlook 中查看电子邮件时,电子邮件如下所示:

但在 Iphone 上查看时,它看起来像:

有没有办法隐藏或在标题中放置主题行而不是出现在正文中? (主题行是:SWAG 邮件列表确认!)

【问题讨论】:

    标签: iphone outlook phpmailer


    【解决方案1】:

    这只是电子邮件客户端之间的区别。您对此无能为力。

    另外,您使用的是非常旧的 PHPMailer 版本(所以更新它),您可以从脚本中删除这些行,因为它们没有做任何事情:

    $mail->IsMail(); //This is the default, so does nothing
    $mail->ContentType="text/HTML"; //Calling isHTML does this for you, but correctly
    $mail->ClearAddresses(); //This does nothing as the instance is destroyed when it goes out of scope
    

    【讨论】:

    • 感谢您的信息。我非常相信如果它没有坏就不要修复它。
    • 根据您正在运行的确切旧版本,您可能正在等待有人利用它包含的 RCE。我认为那是“破产”。
    猜你喜欢
    • 1970-01-01
    • 2014-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多