I\'m trying to send email through mailchimp api version 3.0 in php, but i have no luck. This is my code:
$postString = \'{
\"message\": {
\"h
'Yo, this is the html portion',
'text'=>'Yo, this is the *text* portion',
'subject'=>'This is the subject',
'from_name'=>'Me!',
'from_email'=>'',
'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://us5.sts.mailchimp.com/1.0/SendEmail";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url.'?'.http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
echo $result;
curl_close ($ch);
var_dump($result);
$data = json_decode($result);
echo "Status = ".$data->status."\n";
?>