Hi All,
I am trying to send a mail via mandrill API. I am not get any response for this call. Could anybody give some sample script or correct me if am doing wrong.
Please find the attached code below
My Script:
$url = '
https://mandrillapp.com/api/1.0/messages/send.json';
$headers = array('key' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx',
'message' => array(
"html"=> "Example HTML",
"text"=> "Example TEXT",
"subject"=> "My Emai Subject",
"from_email"=> "
ad...@mydomain.com",
"from_name"=> "BuckSense",
"to"=>array("email"=> "
xxx...@gmail.com", "name"=> "My Name")
));
$curl_handle=curl_init();
curl_setopt($curl_handle, CURLOPT_POST, true);
curl_setopt($curl_handle, CURLOPT_HEADER, false);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, json_encode($headers));
$response = curl_exec($curl_handle);
curl_close($curl_handle);
var_dump( $response);
Thanks,
Vijay