繁体   English   中英

发送电子邮件Transport Mandrill失败

[英]Send email Transport Mandrill failed

我已经竭尽所能,可以与API KEY Mandrill一起向用户(如果您拥有自己的帐户)发送电子邮件。 我可以找到答案,并在此处保留答案,以防有人服务。

Mandrill运输

在email.php中配置Mandrill

public $mandrill = array(
    'transport' => 'Mandrill',
    'uri' => 'https://mandrillapp.com/api/1.0/',
    'api_key' => 'YR3eo8WM9F-Je2********',
);

我的验证码电子邮件:

$email = new CakeEmail();
$email->config('mandrill'); 
$email->from('example@example.com');
$email->to('example2@example.com');
$email->subject('Subject for Email');
$result = $email->send('Here is some test content for the email.');
print_r($result);

回应:

[Mandrill] => Array
    (
        [status] => error
        [code] => -1
        [name] => Invalid_Key
        [message] => Invalid API key
    )

在这种情况下,您会收到此错误消息(对我来说很少,因为api键很好)。

编辑

我意识到,由于使用了示例而不是api_key键,但仅通过更改就可以了:

'api_key' to 'key' => $apikey,

我意识到感谢@César而不是api_key所使用的示例,但仅对我的配置进行了更改才大致输入了密钥:

public $mandrill = array(
    'transport' => 'Mandrill',
    'uri' => 'https://mandrillapp.com/api/1.0/',
    'key' => 'YR3eo8WM9F-Je2********',
);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM