Skip to content

Instantly share code, notes, and snippets.

@zarankumar
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zarankumar/063eca3292f0f764d039 to your computer and use it in GitHub Desktop.
Save zarankumar/063eca3292f0f764d039 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