Solved

e-mail headers comma problem

Posted on 2004-09-13
6
319 Views
Last Modified: 2010-05-18
I'm not sure this is the right area to place the question but since i didn't find more appropriate one, here it is..

In the header the From: field has the following format:

From: John Jin Doe  <john@doe.com>

but I need to have smth like:

From: Jin Doe,  John <john@doe.com>

However this does not work, because it obvously treats this expression as 2 comma-separated e-mails.
And it generates smth. like this:

From: Jin.Doe@mailserver.com, John <john@doe.com>

So the question is, is there a way to encode this comma in some way, so that it doesn't confuse the parser?
0
Comment
Question by:alkalined
6 Comments
 
LVL 11

Accepted Solution

by:
raj3060 earned 125 total points
ID: 12045215
Did you try this;
From: "John Jin Doe" <john@doe.com>
--Raj
0
 
LVL 19

Expert Comment

by:webwoman
ID: 12048328
That's not a good format for a from field. That field should ONLY have the email address. It doesn't need anything else.
0
 
LVL 11

Expert Comment

by:raj3060
ID: 12048969
Then he is gonna need one email address field and one namem field.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 19

Expert Comment

by:webwoman
ID: 12050500
If he wants a name, yes. The name has nothing to do with the email address.

The from field in the email should only be an email address. If you want a name, that's fine, but it doesn't change the from field on the email.

Don't get confused with how the email client DISPLAYS the from field and what it actually IS.
0
 
LVL 5

Expert Comment

by:ITcrow
ID: 12051759
Could you tell us little bit more about what you are doing.
- Are you sending email using script
- Or you are trying to parse received email data.

In either case, I will agree with what Raj said in the beginning. Use double quotes around the name when there is a comma present.
0
 
LVL 1

Author Comment

by:alkalined
ID: 12052033
I'm making a script and I do need the name..
Raj3060's suggestion did the job so i'm giving him the points.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read about why website design really matters in today's demanding market.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question