Name and email properties for Pop3Message class

Apr 22, 2010 at 3:34 PM
Hi, in Pop3Message class i can find From property that return me string in format "server name<sender@domain.com>", but which property should i use for getting separation between name and email? it should be something like FromName and FromEmail properties i think
Coordinator
Apr 23, 2010 at 2:59 PM

You can separate by using Create method of MailAddress class.
I would make consideration to implement property you suggested.

Thank you!

Apr 24, 2010 at 9:41 AM

ok it will be great, thank you a lot

Apr 24, 2010 at 10:00 AM

tried to find this method but without success

should i use something like this:

 

var m=c.GetMessage(x);
MailAddress mail = new MailAddress(m.From);

var email=mail.Value;
var name=mail.DisplayName; 

 

Coordinator
May 1, 2010 at 3:21 AM

You can use Create static method of MailAddress class as below.
Not constructor.

var m=c.GetMessage(x);
MailAddress mail = MailAddress.Create(m.From);
var email=mail.Value;
var name=mail.DisplayName; 

 

May 1, 2010 at 3:40 AM
ok thanks, but i think this it will be great if message will have properties like i wrote:
var m=c.GetMessage(x);
m.FromName, m.FromEmail

On Sat, May 1, 2010 at 05:21, higty <notifications@codeplex.com> wrote:

From: higty

You can use Create static method of MailAddress class as below.
Not constructor.

var m=c.GetMessage(x);
MailAddress mail = MailAddress.Create(m.From);
var email=mail.Value;
var name=mail.DisplayName; 

 

Read the full discussion online.

To add a post to this discussion, reply to this email (csharpmail@discussions.codeplex.com)

To start a new discussion for this project, email csharpmail@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
May 1, 2010 at 8:22 AM

To add your property would cause a little problem about consistency.
If From has Name,EMail property,between From and To,Cc have a difference.
It would better as same property at To,Cc.

I'm thinking about to change type of From property to MailAddress class.
And also change type of To,Cc property to List<MailAddress>.
It would not lose consistency but It is breaking change.
I should keep backward compatibility.
And this change may cause performance issue.
If To property has 1000 mailaddress,to parse 1000 mailaddress's string is not ignorable performance problem.

I still planing to solve this issue.
Thank you.