public class MailMessageImpl extends Object implements MailMessage
| Constructor and Description |
|---|
MailMessageImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(String name,
String value)
Adds a header to the message
|
void |
appendBody(String line)
Appends the given text to the body.
|
void |
appendHeader(String name,
String value)
Append some text to the last existing value of a header.
|
String |
getBody()
Returns the body of the message.
|
String |
getFirstHeaderValue(String name)
A shortcut to get only the first value of a header
|
Iterator<String> |
getHeaderNames()
Gets an iterator over header names.
|
String[] |
getHeaderValues(String name)
Gets the values of a given header.
|
String |
toString() |
public Iterator<String> getHeaderNames()
MailMessagegetHeaderNames in interface MailMessageIteratorpublic String[] getHeaderValues(String name)
MailMessagegetHeaderValues in interface MailMessagename - the name of the header.public String getFirstHeaderValue(String name)
MailMessagegetFirstHeaderValue in interface MailMessagename - is name of the headerpublic String getBody()
MailMessagegetBody in interface MailMessagepublic void addHeader(String name, String value)
MailMessageaddHeader in interface MailMessagename - is the name of the header.value - is the value to add to the header.public void appendHeader(String name, String value)
MailMessageaddHeader method because it doesn't add a new header entry,
instead it appends the given value to an existing header entry.
If the given header name doesn't exist this method will add a new header.appendHeader in interface MailMessagename - is the name of the headervalue - is the value to append to the header.public void appendBody(String line)
MailMessageappendBody in interface MailMessageline - is the text to append.Copyright © 2017. All rights reserved.