Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('/lib/Mandrill.php');
- function sendEmail($options) {
- try {
- $mandrill = new Mandrill('MANDRILL_API_KEY');
- $message = array(
- 'html' => $options['body'],
- 'subject' => $options['subject'],
- 'from_email' => 'from@email.com',
- 'from_name' => 'From Name',
- 'to' => $options['to'], // expects array ( array('email' => 'email', 'type' => 'to/bcc') )
- 'headers' => array('Reply-To' => 'reply@email.com'),
- );
- return $mandrill->messages->send($message, false, 'Main Pool', null);
- } catch(Mandrill_Error $e) {
- // Mandrill errors are thrown as exceptions
- throw $e;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement