add_action( 'phpmailer_init', function( $phpmailer )
{ if ( !is_object( $phpmailer ) )
$phpmailer = (object) $phpmailer;
$phpmailer->Mailer = 'smtp';
$phpmailer->Host = 'smtp.gmail.com';
$phpmailer->SMTPAuth = 1;
$phpmailer->Port = 587;
$phpmailer->Username = 'gmailcuaban@gmail.com'; //@gmail.com
$phpmailer->Password = 'matkhauungdunggmail'; //mk ứng dụng gmail
$phpmailer->SMTPSecure = 'TLS';
$phpmailer->From = 'gmailcuaban@gmail.com'; //@gmail.com
$phpmailer->FromName = 'Tên gửi';
});
{ if ( !is_object( $phpmailer ) )
$phpmailer = (object) $phpmailer;
$phpmailer->Mailer = 'smtp';
$phpmailer->Host = 'smtp.gmail.com';
$phpmailer->SMTPAuth = 1;
$phpmailer->Port = 587;
$phpmailer->Username = 'gmailcuaban@gmail.com'; //@gmail.com
$phpmailer->Password = 'matkhauungdunggmail'; //mk ứng dụng gmail
$phpmailer->SMTPSecure = 'TLS';
$phpmailer->From = 'gmailcuaban@gmail.com'; //@gmail.com
$phpmailer->FromName = 'Tên gửi';
});