WordPress Custom SMTP

DSDalton SuttonMarch 19, 2024
View AllView Notes
<?php 

function daltonsutton_smtp_settings( $phpmailer ) {
    $phpmailer->isSMTP();

    $phpmailer->Host       = 'smtp.mailgun.org';
    $phpmailer->Username   = '[email protected]';
    $phpmailer->Password   = 'password123';
    $phpmailer->SMTPSecure = 'ssl';
    $phpmailer->SMTPAuth   = true;
    $phpmailer->Port       = 465;
    $phpmailer->From       = '[email protected]';
    $phpmailer->FromName   = get_bloginfo('name');
}
add_action('phpmailer_init', 'daltonsutton_smtp_settings');