Code SMTP
Paste code to function.php in Child theme
// tu dong gui email
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 = 'Tài khoản';
$phpmailer->Password = 'Mật khẩu ứng dụng';
$phpmailer->SMTPSecure = 'TLS';
$phpmailer->From = 'Địa chỉ email gửi';
$phpmailer->FromName = 'Tên người gửi';
});
// ket thuc gui email tu dungTake Google app password








Last updated