Created
February 25, 2015 18:36
-
-
Save infn8/b52d3cbf6587d018c376 to your computer and use it in GitHub Desktop.
Use Mandrill SMTP for WordPress wp_mail() function
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
<?php | |
/* Add this to your functions.php or plugin file */ | |
add_action( 'phpmailer_init', 'configure_mandrill_smtp' ); | |
function configure_mandrill_smtp( PHPMailer $phpmailer ){ | |
$phpmailer->isSMTP(); //switch to smtp | |
$phpmailer->Host = 'smtp.mandrillapp.com'; | |
$phpmailer->SMTPAuth = true; | |
$phpmailer->Port = 587; | |
$phpmailer->Username = 'MAILCHIMP_USER'; | |
$phpmailer->Password = 'MAILCHIMP_API_KEY'; | |
$phpmailer->SMTPSecure = 'tls'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment