Skip to content

Instantly share code, notes, and snippets.

View mickythompson's full-sized avatar

Micky Thompson mickythompson

View GitHub Profile
@mickythompson
mickythompson / phpmailer-sample.php
Last active February 2, 2023 16:08
PHPMailer SMTP Code for use with WordPress
<?php
// The code below will allow you to use SMTP in WordPress with no plugin needed.
//-------------
// Place this code in functions.php inside your theme, in a Custom Plugin (plugins) or a Must Use Plugin (mu-plugins).
// Configures SMTP authentication
add_action( 'phpmailer_init', 'send_smtp_email' );
function send_smtp_email( $phpmailer ) {