My php script is running well but i want to send senders address in email subject .Please guide me how to do it.
Please tell me what should i write in "$emailSbuject = "New Subscription from $emailFeild ";"
This is my php script:
<?php
/* subject and email varialbles*/
$emailSbuject = "New Subscription from $emailFeild
";
$webMaster = 'help@sample.com';
$emailSbuject2 = 'Thank you';
$client = ' $emailFeild
';
/*gathering data variables*/
$emailFeild = $_POST['email'];
// admin message body
$body= <<<EOD
New subscriber is $emailFeild
EOD;
$textMessage = <<<EOD
<p style="margin-left:5px;font-family:Calibri"><img alt="" src="http://www.intaxfin.com/images/Intaxfin_logo.png"></p>
<p style="font-family:Calibri">Thank you for subscribing with us. Somebody will get back to you as soon as possible.</p>
<p style="font-size:x-small;color:#0099FF;font-family:Calibri">This e-mail was automatically sent by Administration Directory and is for your reference. Please do not reply to this e- mail address.<br>
Powered by sample</p>
EOD;
$headers = "From: $emailFeild
";
$header = "From: $noreply@sample.com
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
";
$success = mail($webMaster,$emailSbuject,$body,$headers);
$success1 = @mail($emailFeild,$emailSbuject2,$textMessage,$header);
/*Result*/
$theResults = <<<EOD
EOD;
echo "$theResults";
header("Location: thankyousubscribe.html");
exit;
?>
$emailFeild = $_POST['email'];
$emailSbuject2 = "New Subscription from $emailFeild";
NOTE : $client has been initiated with $emailFeild variable which is initiated after that line. Please initiate the variable first and then use it.