Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sent WordPress emails with SMTP - Deliver emails reliably by using SMTP. Use a tiny streamlined plugin to keep things fast.
Plugin Name: Send email via SMTP
Plugin URI:
Description: Send emails via SMTP.
Author: Damien Carbery
Version: 0.1
add_action( 'phpmailer_init', 'send_smtp_email' );
function send_smtp_email( $phpmailer ) {
$phpmailer->Host = '';
$phpmailer->SMTPAuth = true;
$phpmailer->Port = 587;
$phpmailer->Username = '';
$phpmailer->Password = 'ThisIsNotMyPassword';
$phpmailer->SMTPSecure = 'tls';
$phpmailer->From = '';
$phpmailer->FromName = 'My Name';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.