发送到hotmail时的Php邮件功能将其作为加密方式接收

时间:2017-08-11 07:02:04

标签: php email encryption

我创建了一个独立的电子邮件模板软件。这一切都适用于gmail,雅虎甚至是Outlook和其他商业电子邮件。但问题出在hotmail上。当我尝试发送一些示例电子邮件时,收到后会自动加密发送的电子邮件。像这样的东西

  

†Ù¥...æ¶+ exK«“ÒJÖ«μêÒãÚrF{ûb¶W¬·)^μìmrë-r‰Ê%¢¶åiÉ?²Ü¥{ø^iÖèw'b¾)²·&amp;jÚμë- + ^ r‰ŠfzÏÒà@4ÑÀ™à...è†ÒúÒœp‰Ûa÷Í)Ç÷b¾-%jË - {\ËË\¢Z +&amp;¬wúirV¬²×±μˬμÊ%¢±Þè ¬¶¢ú+™«b¢{ajܨº·ª¹ë-y×讉躻-®‰à²-§²¥yÊ%¢ºÞtK«“ÒJÖ«μêÒãÚrF&gt;&gt; {û)j춺 “河北†+)iÉè¬uë“,W〜对™©ejwfyØ®™»¬Šw¬²)ÀºËkjXš¶‡(S-Z‰í... E' - )Þ™ªäz×è®Ø^š<-i ÷è

继承我的代码:

<?php
    $to = $_GET['email'];
    $nameOfClient = $_GET['username'];
    $StarterPackage = "
    <html>
    <head>
    <title>Sample Email Templater</title>
    </head>
    <body>
    <span style='color:black;'>
     This package is designed for small and medium business in Australia to 
     compete on the online market for the most affordable price. If you 
     don't have a website yet, it's the best timing for your business to 
     have one now. If you already have a website it's the perfect time to 
     boost your ranking online for your business advantage and needs.</span>
    </body>
    </html>
    ";

    $headers[] = "MIME-Version: 1.0";
    $headers[] = "Content-type:text/plain; charset=ISO-8859-1";
    $headers[] = "Content-Transfer-Encoding: base64";
    $result = mail($to,$subject,$StarterPackage,implode("\r\n", $headers)); 
?>

1 个答案:

答案 0 :(得分:0)

尝试按照以下方式设置标题,因为您在正文中使用了html元素

$headers[] = "MIME-Version: 1.0";
$headers[] = "Content-Type: text/html; charset=ISO-8859-1";

如果仍然存在任何问题,也可以通过删除以下代码进行检查

$headers[] = "Content-Transfer-Encoding: base64";