Answer the question
In order to leave comments, you need to log in
How to send an email using Mandrill?
You need to send an email using Mandrill.
I do it like this:
require_once 'mandrill-api/src/Mandrill.php';
$mandrill = new Mandrill('Smd-g2j7RNpaiq0L00EYNQ');
$mail = array(
'subject' => 'Some Theme',
'from_email' => '[email protected]',
'from_name' => 'FromName',
'html' => '<h1>Hello</h1>',
'to' => array(array('email' => '[email protected]', 'name' => 'ToName', 'type' => 'to')));
try {
$res = $mandrill->messages->send($mail);
print_r($res);
} catch(Mandrill_Error $error) {
echo 'Error: ' . get_class($error) . ' - ' . $error->getMessage();
}
Array ( [0] => Array ( [email] => [email protected] [status] => rejected [_id] => 059dec07fd8243c69c60a0133f5a8ee9 [reject_reason] => unsigned ) )
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question