What Is the Format for E-Mail Headers That Display a Name Rather Than the E-Mail

What is the format for e-mail headers that display a name rather than the e-mail?

To have names, as opposed to email addresses shown, use the following:

"John Smith" <johnsemail@hisserver.com>

Easy.

Regarding the broken line breaks, that is because you are enclosing the text in apostrophes rather than quotation marks:

$headers = array(
'From: "The Sending Name" <noreply@rilburskryler.net>' ,
'Reply-To: "The Reply To Name" <noreply@rilburskryler.net>' ,
'X-Mailer: PHP/' . phpversion() ,
'MIME-Version: 1.0' ,
'Content-type: text/html; charset=iso-8859-1' ,
'BCC: ' . $emailList
);
$headers = implode( "\r\n" , $headers );

What is the format of email header name email?

Enjoy.

Search stackoverflow for regexes to parse email addresses, you'll quickly see it's futile.

You should probably just do some basic sanity checking and actually attempt to email the name, address pair as you main way of checking if the email is valid.

$email_headers .= 'From:' Returns incorrect format

You should use '<' and '>' symbol surrounding the real email address then prefixed with the display name of the sender.

#### My changed php code ####

$email_headers .= 'From: ' . $first_name . " <noreply@abc.com>\r\n";
$email_headers .= 'Reply-To:' . $email . "\r\n";

How to show Name in gmail inbox - PHP

Append the reply to header

$headers.='Reply-To: '.$_POST["vname"].'<"'.$email.'">'. "\r\n";

How to set the from name in the mail() function

Some (most, I think) email clients check the From field to make sure the domain is the same as the domain that sent the message. This is to prevent spoofing. Try something like
"From: Firstname Lastname <name@domain.com>"

Send an email after register

If you want to specify both sender and sender's name, replace the headers with this:

'From: SITE NAAM <no-reply@mysite.com>'

What e-mail header is needed for a message to be displayed as 'via:'?

I think the via tag is added by the mail server when somebody uses an external (from his domain) smtp server.
Per example,
my email is iceduck@iceduck.net but I send email via Gmail's smtp, you will see From iceduck@iceduck.net via Gmail.com.
If you want to make the via appear then you'll have to send your mail through the smtp server you want to appear in the via.
You can check out this link : http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm

I don't think the solution is in the header.

Best



Related Topics



Leave a reply



Submit