Skip to content

Instantly share code, notes, and snippets.

@FeroVolar
Last active August 29, 2015 14:26
Show Gist options
  • Save FeroVolar/03fcd8e957b515797cea to your computer and use it in GitHub Desktop.
Save FeroVolar/03fcd8e957b515797cea to your computer and use it in GitHub Desktop.
SENDING EMAIL WITH MANDRILL
<?php
function send_email($to_email,$subject,$message1)
{
require_once 'Mandrill.php';
$apikey = 'XXXXXXXXXX'; //specify your api key here
$mandrill = new Mandrill($apikey);
$message = new stdClass();
$message->html = $message1;
$message->text = $message1;
$message->subject = $subject;
$message->from_email = "[email protected]";//Sender Email
$message->from_name = "KOONK";//Sender Name
$message->to = array(array("email" => $to_email));
$message->track_opens = true;
$response = $mandrill->messages->send($message);
}
// https://bitbucket.org/mailchimp/mandrill-api-php/src/9f336b08ea148c80db3b694f3dc737cd4f414e19/src/?at=master
?>
<?php
$to = "[email protected]";
$subject = "This is a test email";
$message = "Hello World!";
send_email($to,$subject,$message);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment