对于Godaddy基于Web的邮件,HTML电子邮件不正确显示 [英] HTML Email not displaying correctly for Godaddy web based mail

查看:155
本文介绍了对于Godaddy基于Web的邮件,HTML电子邮件不正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下PHP代码发送电子邮件。我已经在Outlook和其他地方进行了测试,一切都正常进行。但是,如果我发送电子邮件给一个使用Godaddy网络电子邮件查看器的人,它有两个问题:

I am using the following PHP code to send out an email. I've tested in Outlook and other places and everything comes through correctly. However if I send the email to a person using a Godaddy web based email viewer it has 2 problems:


  • FROM电子邮件地址不显示

  • 而不是显示HTML电子邮件,它显示的是HTML代码

在多台机器和浏览器上的多个基于Godaddy的帐户。

This has been verified with multiple godaddy based accounts on multiple machines and browsers.

以下是我用于发送电子邮件的代码:

Here is the code I am using to send the email:

//build and send the email      
    $to = $email;
    $subject = 'Confirm your subscription';
    $message =( "<html>\r\n");
    $message .=( "<head>\r\n");
    $message .=( "<title>Confirm</title>\r\n");
    $message .=( "</head>\r\n");
    $message .=( "<body>\r\n");
    $message .=( "<h2>Thank You for registering</h2>\r\n");
    $message .=( "<p>To complete your registration, please click the link below.</p>\r\n");
    $message .=(" <p><a href=\"http://www.site.com/confirmation.php?confirm=$visitor_hash\">Click here to confirm your interest.</a></p>\r\n"); 
    $message .=( "</body>\r\n");
    $message .=( "</html>\r\n");

    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
    $headers .= "From: Site<info@site.com>\r\n";
    mail($to, $subject, $message, $headers);

任何想法?

推荐答案

经过多次搜索,发布和调整后,我找到了一个解决方案。我在页面上发现了这个PHP Mail功能,在用户评论中。

After much searching, posting and tweaking I found a solution. I found this on the page for the PHP Mail function, in the user comments.

我更改了以下3行:

$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "From: Site<info@site.com>\r\n";

$headers  ='"MIME-Version: 1.0' . PHP_EOL;
$headers .= 'Content-Type: text/html; charset=ISO-8859-1' . PHP_EOL;
$headers .= 'From: Site<info@site.com>' . PHP_EOL;

解决问题。

谢谢,
Chris

Thanks, Chris

这篇关于对于Godaddy基于Web的邮件,HTML电子邮件不正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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