I was not reading careful enough. Yes I'm using getFrom().
--------------------------------------------------
From: "Eric Charles" <[email protected]>
Sent: Wednesday, July 21, 2010 8:10 PM
To: "James Users List" <[email protected]>
Subject: Re: capture the sender name
True enough.
btw, getPersonal() returns the "display name" of the InternetAddress
(will return null if no display name available).
So to get the "My Name" display name only:
String fromDisplayName = ((InternetAddress)
mail.getMessage().getFrom()[0]).getPersonal();
Tks,
Eric
On 07/21/2010 01:52 PM, Israel Tsadok wrote:
Note that the Sender header does not appear in all messages, and means
something else than the From header. See RFC 822
2010/7/21 冉兵 <[email protected]>
Exactly what I eventually used...
--------------------------------------------------
From: "Eric Charles" <[email protected]>
Sent: Wednesday, July 21, 2010 4:23 PM
To: "James Users List" <[email protected]>
Subject: Re: capture the sender name
yep,
or maybe
String senderName = ((InternetAddress)
mail.getMessage().getSender()).getPersonal();
javadoc is your friend :)
tks,
Eric
On 07/21/2010 10:12 AM, Norman Maurer wrote:
Hi,
use something like:
mail.getMessage().getFrom()[0].toString();
Have a look at the javamail apidocs for more details..
Bye,
Norman
2010/7/21 冉兵 <[email protected]>:
Hi,
In a matcher I'm writing, I need to extract the name part of an email
sender as the "My Name" part as in a sender address "My Name"<me @ a.
com >
I tried the sender but the name part is not there. Where shall I go
for
it?
Thanks
Bing
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]