Skip to content

Instantly share code, notes, and snippets.

@jag1989
Created September 18, 2014 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jag1989/e1aff4443327e7ba8e99 to your computer and use it in GitHub Desktop.
Save jag1989/e1aff4443327e7ba8e99 to your computer and use it in GitHub Desktop.
WordPress send mail via SMTP
add_action( 'phpmailer_init', 'configure_smtp' );
function configure_smtp( PHPMailer $phpmailer ){
$phpmailer->isSMTP(); //switch to smtp
$phpmailer->Host = 'localhost';
$phpmailer->SMTPAuth = false;
$phpmailer->Port = 25;
$phpmailer->Username = 'Username Here';
$phpmailer->Password = 'myemailpassword';
$phpmailer->SMTPSecure = false;
$phpmailer->From = "noreply@email.com";
$phpmailer->FromName="Site Name";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment