Skip to content

Instantly share code, notes, and snippets.

@iandunn
Created August 17, 2016 19:26
Show Gist options
  • Save iandunn/58453917f91ebb53bdb5152c98662fba to your computer and use it in GitHub Desktop.
Save iandunn/58453917f91ebb53bdb5152c98662fba to your computer and use it in GitHub Desktop.
Disable PHPMailer sending via SMTP, so that MailCatcher can catch outbound messages from dev environments
/**
* Configure PHPMailer to send via PHP's mail()
*
* @param PHPMailer $phpmailer
*/
function phpmailer_send_via_mail( $phpmailer ) {
$phpmailer->IsMail();
}
add_action( 'phpmailer_init', 'phpmailer_send_via_mail', 999 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment