WordPress emails going to spam or not sending? PHP mail() is unreliable. Use SMTP instead.
Install Plugin: “WP Mail SMTP” or “Easy WP SMTP”
Or Add to functions.php:
add_action('phpmailer_init', function($phpmailer) {
$phpmailer->isSMTP();
$phpmailer->Host = 'smtp.gmail.com';
$phpmailer->SMTPAuth = true;
$phpmailer->Port = 587;
$phpmailer->Username = 'your-email@gmail.com';
$phpmailer->Password = 'your-app-password';
$phpmailer->SMTPSecure = 'tls';
$phpmailer->From = 'your-email@gmail.com';
$phpmailer->FromName = 'Your Site Name';
});
Gmail App Password: Google Account → Security → 2-Step Verification → App Passwords
Result: 95%+ email delivery rate instead of 50%
