使用php邮件发送的邮件在Outlook中不正确显示 [英] emails sent with php mail don't show up correctly in outlook

查看:977
本文介绍了使用php邮件发送的邮件在Outlook中不正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个最近被移动的网站上工作。移动后,使用php mail()函数 AND 的所有脚本都有标题中的MIME-Version:和Content-type无法正确显示。他们显示如下

 已发送到:asdf@adffdsf.com收到:通过10.114.121.18与SMTP id t17cs128223wac; 
Thu,19 Nov 2009 11:52:35 -0800(PST)收到:由10.231.48.150与SMTP id s22mr755195ibfdge.22.1258660355109;
Thu,2009年11月19日11:52:35 -0800(PST)返回路径:< anonymous@u15366254sdf.onlinehome-server.com>收到:来自u15366254.onlinehome-server.com(u15366254.onlinehome-server.com [74.208.194.179])
由mx.google.com与ESMTP ID 16si2425376iwn.129.2009.11.19.11.52.34;
Thu,2009年11月19日11:52:34 -0800(PST)Received-SPF:pass(google.com:anonymous@u15366254.onlinehome-server.com域名的最佳猜测记录指定为74.208.194.179 sender)client-ip = 74.208.194.179;验证结果:mx.google.com; spf = pass(google.com:anonymous@u15366254.onlinehome-server.com的域名的最佳猜测记录指定74.208.194.179作为允许的发件人)smtp.mail=anonymous@u15386254.onlinehome-server.com收到:(qmail 8341被调用由uid 48); 19 Nov 2009 08:55:35 -0500日期:2009年11月19日08:55:35 -0500
Message-ID:< 20091119185535.8339.qmail@u15386254.onlinehome-server.com&
至:asdf@asdfad.com
主题:零售商应用程序MIME版本:1.0内容类型:text / html; charset = iso-8859-1
From:asdf@asdfad.com

另外消息中的html显示为原始。



当我使用完全相同的脚本在另一台服务器上发送电子邮件时,它的工作原理如预期。此外,使用Swift邮件的网站上的电子邮件脚本也可以正常使用。



我可以修改它们以使用swift,但是还有许多脚本必须被编辑。 / p>

我正在使用php 5.1.6。



任何想法?

解决方案

我认为你的问题与 \\\
QMAIL ,邮件功能文档说明这一点。


注意:如果未收到邮件,
仅尝试使用LF(\\\
)。一些糟糕的
质量Unix邮件传输代理
自动替换LF由CRLF
(如果CRLF是
,则导致CR倍增)。这应该是最后的手段,
,因为它不符合»RFC 2822。


所以你如果你的头是用 \r\\\
分隔,您可能可以用单个 \\\
替换。



bug 报告还提供了一个解决方案使用脚本。


I'm working on a site that was recently moved. After the move all the scripts that use the php mail() function AND have MIME-Version: and Content-type in the header fail to display correctly. They show up like this

Delivered-To: asdf@adffdsf.com Received: by 10.114.121.18 with SMTP id t17cs128223wac;
        Thu, 19 Nov 2009 11:52:35 -0800 (PST) Received: by 10.231.48.150 with SMTP id s22mr755195ibfdge.22.1258660355109;
        Thu, 19 Nov 2009 11:52:35 -0800 (PST) Return-Path: <anonymous@u15366254sdf.onlinehome-server.com> Received: from u15366254.onlinehome-server.com (u15366254.onlinehome-server.com [74.208.194.179])
        by mx.google.com with ESMTP id 16si2425376iwn.129.2009.11.19.11.52.34;
        Thu, 19 Nov 2009 11:52:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of anonymous@u15366254.onlinehome-server.com designates 74.208.194.179 as permitted sender) client-ip=74.208.194.179; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of anonymous@u15366254.onlinehome-server.com designates 74.208.194.179 as permitted sender) smtp.mail=anonymous@u15386254.onlinehome-server.com Received: (qmail 8341 invoked by uid 48); 19 Nov 2009 08:55:35 -0500 Date: 19 Nov 2009 08:55:35 -0500 
Message-ID: <20091119185535.8339.qmail@u15386254.onlinehome-server.com> 
To: asdf@asdfad.com 
Subject: Retailer Application MIME-Version: 1.0 Content-type: text/html; charset=iso-8859-1 
From: asdf@asdfad.com

In addition the html in the message shows up raw.

When I use the exact same script to send an email on another server it works as expected. Also the email scripts on the site that use Swift mail work fine.

I could just modify them to use swift but there are many scripts that would have to be edited.

I'm using php 5.1.6.

Any ideas?

解决方案

I think your problem is related with \n and QMAIL, the mail function documentation state this.

Note: If messages are not received, try using a LF (\n) only. Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with » RFC 2822.

so you if you header are separated by \r\n you could probably replace those by single \n.

This bug report also provide a solution using a script.

这篇关于使用php邮件发送的邮件在Outlook中不正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆