使用mandrill php api发送10000邮件警报

时间:2014-11-24 18:40:40

标签: php email mandrill

我正在开发一个网络应用程序。我必须一次发送10000封电子邮件警报。我使用了mandrill php API这样做。

执行应用程序时,它不会产生error_log或任何错误消息。我无法接收信号邮件。我尝试了很多。以下是我的PHP代码...

$mandrill = new Mandrill('KEY'); 
try
{                    
    $message = array(
            'subject' => '[ Domain ] Alert',
            'html' => '<div style="width:832px;text-align:left;background-color: #F6F6F6;color: #656565;border: 1px solid #DDDDDD;padding: 20px 0 20px 0;font-family: Arial;font-weight: normal;font-size: 13px;">
                        <img src="http://domain.in/images/logo1.png" alt="Domain" height="111px" width="245px" />
                        <h2>&nbsp;&nbsp;&nbsp;$ename&nbsp;&nbsp;&nbsp;</h2>
                        <h3>&nbsp;&nbsp;&nbsp;Dear $mname,&nbsp;&nbsp;&nbsp;</h3>
                        <p>&nbsp;&nbsp;&nbsp;$emessage&nbsp;&nbsp;&nbsp;</p>
                        <p>&nbsp;</p>
                        <div style="text-align:center;">
                            <a href=http://domain.in" style="font-family: Arial;font-size: 13px;font-weight: bold;color: #FFFFFF;text-decoration: none;text-align: left;background-color: #08B955;border:1px solid #A7ADAD;padding: 10px 50px 10px 50px;cursor: pointer;border-radius: 20px;" target="_blank">Click Here to Vote</a>
                        </div>
                        <p>&nbsp;</p>
                        <p>&nbsp;</p>
                        <p><strong>&nbsp;&nbsp;&nbsp;$ceo_name,</strong><br />&nbsp;&nbsp;&nbsp;Chief Election Officer</p>
                    </div>',
            'from_email' => 'support@domain.in',
            'from_name' => 'domain.in', //optional
            'to' => array(
                    array( // add more sub-arrays for additional recipients
                            'email' => '$email', //example@domain.com
                            'name' => '$mname',
                            'type' => 'to'
                            )
            ),
    );

    $result = $mandrill->messages->send($message);
    print_r($result); //only for debugging

}
catch(Mandrill_Error $e)
{                    
    echo 'A mandrill error occurred: ' . get_class($e) . ' - ' . $e->getMessage();                   
    throw $e;
}

提前致谢。

0 个答案:

没有答案