You don’t need to pass the from name and email to PHPMailer in your code as it will take it from $headers
so try the following:
add_action( "phpmailer_init", "send_smtp_email" );
function send_smtp_email( $phpmailer ) {
// ini_set("sendmail_from","[email protected]");
// ini_set("sendmail_path","[email protected]");
// Define that we are sending with SMTP
$phpmailer->isSMTP();
// The hostname of the mail server
$phpmailer->Host = "localhost";
// Use SMTP authentication (true|false)
$phpmailer->SMTPAuth = false;
// SMTP port number - likely to be 25, 465 or 587
$phpmailer->Port = "25";
// Encryption system to use - ssl or tls
$phpmailer->SMTPSecure = "tls";
// $phpmailer->From = "[email protected]";
// $phpmailer->FromName = "XYZ";
}
Also, double check the form field name for: $_POST['namee']