ZF1 と ZF2 で次の関数を使用するとメール チンプが動作しないのはなぜですか?
class TestController extends Zend_Controller_Action {
public function indexAction() {
echo $this->Mailb(
"from@gmail.com",
"to@gmail.com",
"Mail sucks",
"PING PINGO",
'me@gmail.com,me1@gmail.com,me2@gmail.com',
);
}
public static function Mailb($from, $to, $subject, $htmlBody,
$bcc = '') {
$uri = 'https://mandrillapp.com/api/1.0/messages/send.json';
$postString = '{
"key": "erewrrwerewrewrewrewrewr",
"message": {
"html": "' .$htmlBody. '",
"text": "' .$htmlBody. '",
"subject": "' .$subject.'",
"from_email": "' .$from. '",
"from_name": "BLA 1",
"to": [
{
"email": "' . $to . '",
"name": "BLA 2"
}
],
"headers": {
},
"track_opens": true,
"track_clicks": true,
"auto_text": true,
"url_strip_qs": true,
"preserve_recipients": true,
"merge": true,
"global_merge_vars": [
],
"merge_vars": [
],
"tags": [
],
"google_analytics_domains": [
],
"google_analytics_campaign": "...",
"metadata": [
],
"recipient_metadata": [
],
"attachments": [
]
},
"async": false
}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
$result = curl_exec($ch);
}
}
編集:主なエラー
今:[{"email":"to@gmail.com","status":"sent","_id":"1cbe2f9a2d","reject_reason":null}]