小编roh*_*hit的帖子

使用邮件发送电子邮件黑猩猩api

我正在尝试使用邮件黑猩猩api发送电子邮件,但发生以下错误

{"aws_type":null,"aws_code":null,"http_code":500,"message":"Invalid Mailchimp API Key: <snip>-us5 . You are accessing the wrong datacenter - your client library may not properly support our datacenter mapping scheme."}
Run Code Online (Sandbox Code Playgroud)

我检查了我的mailchimp api密钥及其正确.如果有人知道请回复以下是我的代码

    $apikey = 'api_key';

$to_emails = array('rohith038@gmail.com');
$to_names = array('You', 'Your Mom');

$message = array(
    'html'=>'Yo, this is the <b>html</b> portion',
    'text'=>'Yo, this is the *text* portion',
    'subject'=>'This is the subject',
    'from_name'=>'Me!',
    'from_email'=>'verifed@example.com',
    'to_email'=>$to_emails,
    'to_name'=>$to_names
);

$tags = array('WelcomeEmail');

$params = array(
    'apikey'=>$apikey,
    'message'=>$message,
    'track_opens'=>true,
    'track_clicks'=>false,
    'tags'=>$tags
);

$url = "http://us1.sts.mailchimp.com/1.0/SendEmail";

$ch = curl_init(); …
Run Code Online (Sandbox Code Playgroud)

php api mailchimp

5
推荐指数
1
解决办法
7265
查看次数

标签 统计

api ×1

mailchimp ×1

php ×1