【问题标题】:SEND MAIL IN PHP USING SMTP AUTH [duplicate]使用 SMTP AUTH 在 PHP 中发送邮件 [重复]
【发布时间】:2017-01-20 22:04:01
【问题描述】:

我一直在使用邮件代码在其他服务器上发送邮件,没有任何失败。但是对于一个特定的新服务器,我需要添加 SMTP 授权来发送邮件 这是我经过大量研发后编写的以下代码。 我仍然无法发送邮件。

$new = "Hi, This is Test mail";
$new .= "</table><table width=\"100%\" align=\"left\" border=\"0\" bordercolor=\"#000000\" cellpadding=\"0\" cellspacing=\"0\" class=Head>                                                                                                  

            <tr><Td colspan=3><strong>This is system generated mail,Please do not respond</strong></Td></tr>
            <tr><Td colspan=3><strong>Thanks</strong>,</Td></tr>
            </table>

    </head>
    </body>
    </html>";

echo $new;  


    $to= "<omg@gmail.com>;\r\n";
$subject = "Test Mail";
$host ='xyz.com';
$username='abc@gmail.com';
$password='89393@998';

$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers.= "From:TEST MAIL CRM<abc.gmail.com>\r\n";
    //$headers .= "Bcc:<dd@gmail.com>\r\n";


if(isset($_REQUEST['sendmail'])){
echo $to;
mail($to, $subject, $new, $headers);
    echo "<h1>Mail Send Successfully</h1>";
}

【问题讨论】:

    标签: php email smtp smtpclient smtp-auth


    【解决方案1】:
    猜你喜欢
    • 2013-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-10
    • 2013-08-20
    • 1970-01-01
    • 2016-08-30
    相关资源
    最近更新 更多