Created
March 21, 2018 18:35
-
-
Save ljanecek/812b7f5c96c4aa77ffa81a609056d7fa to your computer and use it in GitHub Desktop.
Mandrill, WP, wp_mail, How to Send Mandrill Email via wp_mail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('phpmailer_init', function( PHPMailer $phpmailer ){ | |
$phpmailer->isSMTP(); | |
$phpmailer->Host = 'smtp.mandrillapp.com'; | |
$phpmailer->SMTPAuth = true; | |
$phpmailer->Port = 587; | |
$phpmailer->Username = 'USERNAME'; | |
$phpmailer->Password = 'APIKEY'; | |
$phpmailer->SMTPSecure = 'tls'; | |
$phpmailer->addCustomHeader('X-MC-Subaccount', 'SUBACCOUNT'); | |
$phpmailer->setFrom('default@email.com', 'Default Title'); | |
$phpmailer->SMTPOptions = array( | |
'ssl' => array( | |
'verify_peer' => false, | |
'verify_peer_name' => false, | |
'allow_self_signed' => true | |
) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment