Hello
I am using the mail() function to send email.
I would like to set the mail headers such that when I will receive an email from someone, the From field will look like:
From: John Smith
where Jogn Smith would be the name of the person (available to me when I call the mail function.
However, when I reply to the mail, the reply will be sent to John Smith’s mail address.
Here is my code:
[code=php]
$name = ‘John Smith’
// $email holds the email address of John Smith
$header = “From: ” .$email;
$message = “Hello, this is a test”;
mail(‘[email protected]’, ‘this is the subject’, $message, $header);
My question is this:
How can I use the $name variable with the mail headers to acheive what I want.
regards
Jason