Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic mail headers 1

Status
Not open for further replies.

frozenpeas

Technical User
Sep 13, 2001
893
CA
Hi,

I need to customize the mail header but am not sure how to go about it. Here is where I am at:

Code:
$header = "From: $row['namef'].' '.$row['namel']\r\n"
		  ."Reply-To: $row['email']\r\n"
  		  ."\"MIME-Version: 1.0\"\r\n"
		  ."Content-Type: text/plain;";

which yeilds "From: .''.

My $row values are good. Thanks. frozenpeas
 
Here's how I do it...

<?php
header(&quot;Location: thankyou.html&quot;);
if($submit)
{
$myname = &quot;$fname $lname&quot;;
$myemail = &quot;$email&quot;;

$contactname = &quot;whatever&quot;;
$contactemail = &quot;youremail@address.com&quot;;

$message = &quot;$fname $lname<br>$address<br>$city, $state $zipcode<br>$email<br>$phone<br><br>$comments&quot;;

$subject = &quot;Put the subject in here.&quot;;

$headers .= &quot;MIME-Version: 1.0\r\n&quot;;
$headers .= &quot;Content-type: text/html; charset=iso-8859-1\r\n&quot;;
$headers .= &quot;From: &quot;.$myname.&quot; <&quot;.$myemail.&quot;>\r\n&quot;;
$headers .= &quot;To: &quot;.$contactname.&quot; <&quot;.$contactemail.&quot;>\r\n&quot;;
$headers .= &quot;Reply-To: &quot;.$myname.&quot; <$myemail>\r\n&quot;;
$headers .= &quot;X-Priority: 1\r\n&quot;;
$headers .= &quot;X-MSMail-Priority: High\r\n&quot;;
$headers .= &quot;X-Mailer: &quot;;

mail($contactemail, $subject, $message, $headers);
}
?>
 
Try this:

Code:
$header = &quot;From: &quot; . $row[&quot;namef&quot;] . &quot; &quot;. $row[&quot;namel&quot;] . &quot;\r\n&quot;
          .&quot;Reply-To: &quot; . $row[&quot;email&quot;] . &quot;\r\n&quot;
          .&quot;\&quot;MIME-Version: 1.0\&quot;\r\n&quot;
          .&quot;Content-Type: text/plain;&quot;;
Regards
David Byng
bd_logo.gif

davidbyng@hotmail.com
 
Are you sure that you want quotes on this line?
[tt]&quot;\&quot;MIME-Version: 1.0\&quot;\r\n&quot;[/tt] //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top