Javascript Mandrill文件给出500错误,但仍在执行功能

Javascript Mandrill文件给出500错误,但仍在执行功能,javascript,php,mandrill,Javascript,Php,Mandrill,我有一个mandrill PHP SDK,用于执行从用户到管理员的事务性电子邮件 我面临的问题是在提交表单时,mandrill文件给出了一个错误500,但它仍然执行该功能,管理员仍然收到电子邮件 mandrill PHP文件: <?php require('./mandrill/Mandrill.php'); $html = 'Hey, <br>'.'You got mail from '.$_GET['Name'].' email: '.$_GET['Email'].' ph

我有一个mandrill PHP SDK,用于执行从用户到管理员的事务性电子邮件

我面临的问题是在提交表单时,mandrill文件给出了一个错误500,但它仍然执行该功能,管理员仍然收到电子邮件

mandrill PHP文件:

<?php
require('./mandrill/Mandrill.php');
$html = 'Hey, <br>'.'You got mail from '.$_GET['Name'].' email: '.$_GET['Email'].' phone: '.$_GET['Phone'].'.<br>Their message is, '.$_GET['message'];
try {
    $mandrill = new Mandrill('KEY_GOES_HERE');
    $message = array(
        'html' => $html,
        'subject' => 'User Message',
        'from_email' => 'random@email.com',
        'from_name' => 'random_name',
        'to' => array(
            array(
                'email' => 'to_random@email.com',
            )
        ),
        'headers' => array('Reply-To' => 'none'),
        'important' => false,
        'track_opens' => null,
        'track_clicks' => null,
        'auto_text' => null,
        'auto_html' => null,
        'inline_css' => null,
        'url_strip_qs' => null,
        'preserve_recipients' => null,
        'view_content_link' => null,
        'bcc_address' => 'message.bcc_address@example.com',
        'tracking_domain' => null,
        'signing_domain' => null,
        'return_path_domain' => null,
        'merge' => true,
        'global_merge_vars' => array(
            array(
                'name' => 'merge1',
                'content' => 'merge1 content'
            )
        ),
    );
    $async = false;


    $result = $mandrill->messages->send($message, $async, $ip_pool, $send_at);
    print_r($result);
    /*
    Array
    (
        [0] => Array
            (
                [email] => recipient.email@example.com
                [status] => sent
                [reject_reason] => hard-bounce
                [_id] => abc123abc123abc123abc123abc123
            )

    )
    */
} catch(Mandrill_Error $e) {
    // Mandrill errors are thrown as exceptions
    echo 'A mandrill error occurred: ' . get_class($e) . ' - ' . $e->getMessage();
    // A mandrill error occurred: Mandrill_Unknown_Subaccount - No subaccount exists with the id 'customer-123'
    throw $e;
}
?>

这个特殊的问题只有在GoDaddy主机上才能解决,而它在我的本地主机上工作得非常好。如何解决这个问题?

我有时会看到500个无效密钥错误-例如,如果您有一个受限制的API密钥。但是我不希望邮件仍然被发送

你检查过房间了吗

$("#submit").on("click", function() {
    var e = $("#modal-contact-form").serialize();
    if (!n()) return false;
    $.ajax({
        type: 'GET',
        url: "./mandrill_mailer.php",
        data: e,
        success: function() {
            alert("Got it, thanks! We'll be in touch soon!");
            $("#modal-contact-form").find("input[type=text], textarea").val("")
        }
    });
    return false
});