Skip to content

Instantly share code, notes, and snippets.

@mattheu
Last active December 25, 2015 19:09
Show Gist options
  • Save mattheu/7025636 to your computer and use it in GitHub Desktop.
Save mattheu/7025636 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: PHPMailer SMTP Settings
* Description: Enables SMTP servers, SSL/TSL authentication and SMTP settings.
*/
defined( 'ABSPATH' ) OR exit;
add_action( 'phpmailer_init', 'my_phpmailer_init' );
function my_phpmailer_init( PHPMailer $phpmailer ) {
$phpmailer->Host = 'smtp.mandrillapp.com';
$phpmailer->Port = 587;
$phpmailer->Username = '';
$phpmailer->From = '';
$phpmailer->Password = '';
$phpmailer->SMTPAuth = true;
// $phpmailer->SMTPSecure = 'ssl'; // enable if required, 'tls' is another possible value
// if ( defined( 'HM_DEV' ) && HM_DEV ) {
// $phpmailer->ClearAllRecipients();
// $phpmailer->AddAddress( '[email protected]' );
// }
$phpmailer->IsSMTP();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment