Skip to content

Instantly share code, notes, and snippets.

@priteshgupta
Created March 7, 2014 16:06
Show Gist options
  • Save priteshgupta/9414309 to your computer and use it in GitHub Desktop.
Save priteshgupta/9414309 to your computer and use it in GitHub Desktop.
<?php
$uri = 'https://mandrillapp.com/api/1.0/messages/send.json';
$params = array(
"key" => 'KEY_GOES_HERE',
"message" => array(
"html" => 'HTML_MAIL',
"to" => array(
array("email" => 'TO_MAIL')
),
"from_email" => 'From_Email',
"from_name" => 'From_Name',
"subject" => 'Email_Subject',
"auto_text" => true,
"track_opens" => true,
"track_clicks" => true
),
"async" => false
);
$postString = json_encode($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
curl_exec($ch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment