<?php
function daltonsutton_smtp_settings( $phpmailer ) {
$phpmailer->isSMTP();
$phpmailer->Host = 'smtp.mailgun.org';
$phpmailer->Username = 'test@example.com';
$phpmailer->Password = 'password123';
$phpmailer->SMTPSecure = 'ssl';
$phpmailer->SMTPAuth = true;
$phpmailer->Port = 465;
$phpmailer->From = 'testing@mg.example.com';
$phpmailer->FromName = get_bloginfo('name');
}
add_action('phpmailer_init', 'daltonsutton_smtp_settings');