public class Body extends Object implements Serializable, 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.
Constructor and Description |
---|
Body()
Default constructor for a new Body object.
|
Body(Content text)
Constructs a new Body object.
|
Modifier and Type | Method and Description |
---|---|
Body |
clone() |
boolean |
equals(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.
|
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.
|
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 Content getText()
public void setText(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 Body withText(Content text)
Returns a reference to this object so that method calls can be chained together.
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 getHtml()
public void setHtml(Content html)
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 withHtml(Content html)
Returns a reference to this object so that method calls can be chained together.
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 String toString()
toString
in class Object
Object.toString()
Copyright © 2015. All rights reserved.