Getting the message headers |
You may retrieve all message headers using the EmailMessage#getHeaders method. This will return a java.util.Enumeration of com.jscape.inet.mime.MimeHeader. To retrieve common headers such as Subject, To, From and others you may use the convenience methods provided in the EmailMessage class.
Example
// get headers Enumeration e = message.getHeaders();
// print out name and value for each header while(e.hasMoreElements()) { MimeHeader h = (MimeHeader)e.nextElement(); System.out.println(h.getName() + ": " + h.getValue()); }
Example
// get subject header value String subject = message.getSubject();
|