Skip to content

Instantly share code, notes, and snippets.

@Kokil
Last active September 1, 2015 05:41
Show Gist options
  • Save Kokil/8358ea5a3db6caad424f to your computer and use it in GitHub Desktop.
Save Kokil/8358ea5a3db6caad424f to your computer and use it in GitHub Desktop.
Simple send an email via Mandrill API. I could not find this anywhere else so hopefully it is helpful to somebody else. At this point you should be able to look at the api docs and figure out the different options.
// Send Email
require_once 'Mandrill.php';
$mandrill = new Mandrill($apikey);
$message = new stdClass();
$message->html = "html message";
$message->text = "text body";
$message->subject = "email subject";
$message->from_email = "address@test.com";
$message->from_name = "From Name";
$message->to = array(array("email" => "recipient@test.com"));
$message->track_opens = true;
$response = $mandrill->messages->send($message);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment