PHP HTML邮件消息转向垃圾邮件

时间:2014-06-10 15:52:02

标签: php email

当我的客户端尝试此操作时,邮件总是会发送垃圾邮件。在我告诉他这只是他的设置之前,我想确定这里没有任何东西会让它变成垃圾邮件。 HTML邮件中的任何内容都是您的首要问题吗?

$to        = $_POST["email"];
$promo      = $_POST["promo"];
$subject    = 'Laser Wash - Wash Code';
$message    = '<style>
                    body {
                        padding: 10px !important;
                        margin: 0 0 0 0 !important;
                        text-align: center !important;
                        color: #fff !important;
                        font-family: Arial;
                    }
                    table, tr, td {
                        padding: 0 0 0 0 !important;
                        margin: 0 0 0 0 !important;
                        color: #fff !important;
                        font-family: Arial;
                    }
                    table {
                        background: #000 url(http://www.noahyamen.com/laser/img/background.jpg) no-repeat;
                        text-align: center !important;
                        margin: 0 auto 0 auto !important;
                        width: 550px !important;
                        height: 590px !important;
                        -webkit-box-shadow: 0px 10px 20px 0px rgba(50, 50, 50, 0.5);
                        -moz-box-shadow:    0px 10px 20px 0px rgba(50, 50, 50, 0.5);
                        box-shadow:         0px 10px 20px 0px rgba(50, 50, 50, 0.5);
                    }
                </style>
                <body style="padding: 10px !important; margin: 0 0 0 0 !important; text-align: center !important; color: #fff !important; font-family: Arial;">
                    <table style="background: #000 url(http://www.noahyamen.com/laser/img/background.jpg) no-repeat; text-align: center !important; margin: 0 auto 0 auto !important; width: 550px !important; height: 590px !important; -webkit-box-shadow: 0px 10px 20px 0px rgba(50, 50, 50, 0.5); -moz-box-shadow: 0px 10px 20px 0px rgba(50, 50, 50, 0.5); box-shadow: 0px 10px 20px 0px rgba(50, 50, 50, 0.5);">
                        <tr>
                            <td style="padding: 35px !important; height: 87px !important;"><a href="#"><img src="http://www.noahyamen.com/laser/img/executive-laser-wash-logo.gif" width="247" height="87" alt="Executive Laser Car Wash" /></a></td>
                        </tr>
                        <tr>
                            <td style="padding: 20px !important; font-size: 18px !important; height: 18px !important;">Your wash code is below:</td>
                        </tr>
                        <tr>
                            <td style="padding: 25px !important; font-family: Impact; font-size: 40px !important; height: 40px !important; background: url(http://www.noahyamen.com/laser/img/promo-code-background.gif) no-repeat center; text-transform: uppercase !important;">'.$promo.'</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                        </tr>
                    </table>    
                </body>';
$headers    =   'From: info@executivelaserwash.com' . "\r\n" .
                'Reply-To: info@executivelaserwash.com' . "\r\n" .
                'MIME-Version: 1.0' . "\r\n" .
                'Content-Type: text/html; charset=ISO-8859-1' . "\r\n" .
                'X-Mailer: PHP/' . phpversion();

2 个答案:

答案 0 :(得分:1)

有时人们会订阅过滤基本黑名单的服务,并且邮件服务器的IP地址或主机名可以添加到这些列表(即spambot)中,并且这些服务将无法控制。您必须直接与过滤器列表创建者联系,这通常很痛苦,因为您必须收到通知,您的邮件已被某人过滤。

它也可能依赖于最终用户的垃圾邮件过滤器,所以看到它被标记为垃圾邮件的原因总是很棘手,因为即使默认过滤器包含一些任意的红旗,例如来自地址或主题的某些短语出现的行&#34;怀疑&#34;。

答案 1 :(得分:0)

我相信它可以帮助包含收件人的显示名称(也可能包括发件人,但我不确定)。

这样的东西

$to = 'Executive Laser Wash <info@executivelaserwash.com>';

可能有帮助。