Example usage for javax.mail Header getName

List of usage examples for javax.mail Header getName

Introduction

In this page you can find the example usage for javax.mail Header getName.

Prototype

public String getName() 

Source Link

Document

Returns the name of this header.

Usage

From source file:org.simplejavamail.internal.util.MimeMessageParser.java

private static boolean isCustomUserHeader(final Header header) {
    return !DEFAULT_HEADERS.contains(header.getName());
}

From source file:org.socraticgrid.displaymaildata.DisplayMailDataHandler.java

/**
 * Prints all header attributes in a Msg
 * @param msgs/*from w  w w  .ja va  2 s  .  c om*/
 */
void printEmailMsg(Message msg) throws MessagingException {
    Enumeration headers = msg.getAllHeaders();
    while (headers.hasMoreElements()) {
        Header h = (Header) headers.nextElement();
        System.out.println(h.getName() + ": " + h.getValue());
    }
}

From source file:org.springframework.ws.transport.mail.MailSenderConnection.java

@Override
protected Iterator<String> getResponseHeaderNames() throws IOException {
    try {//  ww w  .  j a va2s .c  o m
        List<String> headers = new ArrayList<String>();
        Enumeration<?> enumeration = responseMessage.getAllHeaders();
        while (enumeration.hasMoreElements()) {
            Header header = (Header) enumeration.nextElement();
            headers.add(header.getName());
        }
        return headers.iterator();
    } catch (MessagingException ex) {
        throw new MailTransportException(ex);
    }
}