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: Select all
$name = 'John Smith'
// $email holds the email address of John Smith
$header = "From: " .$email;
$message = "Hello, this is a test";
mail('test@test.com', 'this is the subject', $message, $header);How can I use the $name variable with the mail headers to acheive what I want.
regards
Jason