Reputation: 115952
i need to use some sort of a port to javaMail (link here ) that takes messages from an email server (gmail in my case, but might change in the future) , and reads some information from them.
one of the things i've noticed in the API is that getFrom method returns an array of Address objects , as shown here .
my question is : in which cases would this method return :
?
all of my emails always had exactly one sender , no matter how weird it was sent (CC,BCC,forward,...) .
they say there "In certain implementations, this may be different from the entity that actually sent the message." , so how could i know for sure who sent the message, and if the current implementation is fine?
Upvotes: 0
Views: 404
Reputation: 195
The frist two are DIRECTLY from the api:
(This attribute = the 'from' attribute of the email in question)
1) This method returns null if this attribute is not present in this message.
2) Returns an empty array if this attribute is present, but contains no addresses.
3) It checks the 'from' field of the email and returns an array of Address objects with one Address per entity found in that field. So, it will return an array of size > 1 when there is more than one 'sender' listed
Upvotes: 1