1

I am facing problem in $header from: with variable when i put the $cname variable in $header from: i don't receive any mail but when i put a $fname in $header from: so i get mail what is the problem please help. Below is the php form code.

<?php 
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$phone = $_POST['phone'];
$cname = $_POST['cname'];
$email = $_POST['email'];
$city = $_POST['city'];
$state = $_POST['state'];
$interested = $_POST['interested'];
$message = $_POST['message'];
//
// Mail Content
$formcontent="
First Name : $fname \n 
Last Name : $lname \n 
Phone : $phone \n 
Company Name : $cname \n 
Email : $email \n 
City : $city \n 
State : $state \n 
Interested For : $interested \n
Message : $message";
//
$recipient = "demo@gmail.com";
$subject = "Print Pluss Query";
$header = "From: $cname \r\n";
mail($recipient, $subject, $formcontent, $header) or die("Error!");
?>

0 Answers0