public class Body
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Represents the body of the message. You can specify text, HTML, or both. If you use both, then the message should display correctly in the widest variety of email clients.
Modifier and Type | Field and Description |
---|---|
private Content |
html
The content of the message, in HTML format.
|
private Content |
text
The content of the message, in text format.
|
Constructor and Description |
---|
Body()
Default constructor for Body object.
|
Body(Content text)
Constructs a new Body object.
|
Modifier and Type | Method and Description |
---|---|
Body |
clone() |
boolean |
equals(java.lang.Object obj) |
Content |
getHtml()
The content of the message, in HTML format.
|
Content |
getText()
The content of the message, in text format.
|
int |
hashCode() |
void |
setHtml(Content html)
The content of the message, in HTML format.
|
void |
setText(Content text)
The content of the message, in text format.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
Body |
withHtml(Content html)
The content of the message, in HTML format.
|
Body |
withText(Content text)
The content of the message, in text format.
|
private Content text
The content of the message, in text format. Use this for text-based email clients, or clients on high-latency networks (such as mobile devices).
private Content html
The content of the message, in HTML format. Use this for email clients that can process HTML. You can include clickable links, formatted text, and much more in an HTML message.
public Body()
public Body(Content text)
text
- The content of the message, in text format. Use this for
text-based email clients, or clients on high-latency networks
(such as mobile devices).public void setText(Content text)
The content of the message, in text format. Use this for text-based email clients, or clients on high-latency networks (such as mobile devices).
text
- The content of the message, in text format. Use this for
text-based email clients, or clients on high-latency networks
(such as mobile devices).public Content getText()
The content of the message, in text format. Use this for text-based email clients, or clients on high-latency networks (such as mobile devices).
public Body withText(Content text)
The content of the message, in text format. Use this for text-based email clients, or clients on high-latency networks (such as mobile devices).
text
- The content of the message, in text format. Use this for
text-based email clients, or clients on high-latency networks
(such as mobile devices).public void setHtml(Content html)
The content of the message, in HTML format. Use this for email clients that can process HTML. You can include clickable links, formatted text, and much more in an HTML message.
html
- The content of the message, in HTML format. Use this for email
clients that can process HTML. You can include clickable links,
formatted text, and much more in an HTML message.public Content getHtml()
The content of the message, in HTML format. Use this for email clients that can process HTML. You can include clickable links, formatted text, and much more in an HTML message.
public Body withHtml(Content html)
The content of the message, in HTML format. Use this for email clients that can process HTML. You can include clickable links, formatted text, and much more in an HTML message.
html
- The content of the message, in HTML format. Use this for email
clients that can process HTML. You can include clickable links,
formatted text, and much more in an HTML message.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Body clone()
clone
in class java.lang.Object