Hi,
I am using this to as header for my email form submition send.php file:
$mailheader = "From: ".$_POST["email"]."\r\n";
but I also have
$_POST["email"]
coming from the contact.php form.
I want to know how can I send the email but make sure to show the name and in the From like this Jassim Rahma <jassim@email.com> so the name will be shown in the inbox of the recipient's email instead of the email address
Thanks, Jassim
$mailheader = "From: NAME <" . $_POST['email'] . ">";
Example: $mailheader = "From: " . $POST['name'] . " <" . $POST['email'] . ">";
Then pass it into mail()
Example: mail($to, $subject, $message, $mailheader);
Note that if you're going to use a user-supplied e-mail address in the 'From' header, then you need to specify a 'Sender' header using a valid e-mail address on your domain. Otherwise, you'll likely be considered to be an open relay and blacklisted from many e-mail servers.
Thanks