public class SimpleMailMessage extends Object implements MailMessage, Serializable
Consider JavaMailSender
and JavaMail MimeMessages
for creating
more sophisticated messages, for example messages with attachments, special
character encodings, or personal names that accompany mail addresses.
MailSender
,
JavaMailSender
,
MimeMessagePreparator
,
MimeMessageHelper
,
MimeMailMessage
,
Serialized FormConstructor and Description |
---|
SimpleMailMessage()
Create a new
SimpleMailMessage . |
SimpleMailMessage(SimpleMailMessage original)
Copy constructor for creating a new
SimpleMailMessage from the state
of an existing SimpleMailMessage instance. |
Modifier and Type | Method and Description |
---|---|
void |
copyTo(MailMessage target)
Copy the contents of this message to the given target message.
|
boolean |
equals(Object other) |
String[] |
getBcc() |
String[] |
getCc() |
String |
getFrom() |
String |
getReplyTo() |
Date |
getSentDate() |
String |
getSubject() |
String |
getText() |
String[] |
getTo() |
int |
hashCode() |
void |
setBcc(String bcc) |
void |
setBcc(String[] bcc) |
void |
setCc(String cc) |
void |
setCc(String[] cc) |
void |
setFrom(String from) |
void |
setReplyTo(String replyTo) |
void |
setSentDate(Date sentDate) |
void |
setSubject(String subject) |
void |
setText(String text) |
void |
setTo(String to) |
void |
setTo(String[] to) |
String |
toString() |
public SimpleMailMessage()
SimpleMailMessage
.public SimpleMailMessage(SimpleMailMessage original)
SimpleMailMessage
from the state
of an existing SimpleMailMessage
instance.public void setFrom(String from)
setFrom
in interface MailMessage
public String getFrom()
public void setReplyTo(String replyTo)
setReplyTo
in interface MailMessage
public String getReplyTo()
public void setTo(String to)
setTo
in interface MailMessage
public void setTo(String[] to)
setTo
in interface MailMessage
public String[] getTo()
public void setCc(String cc)
setCc
in interface MailMessage
public void setCc(String[] cc)
setCc
in interface MailMessage
public String[] getCc()
public void setBcc(String bcc)
setBcc
in interface MailMessage
public void setBcc(String[] bcc)
setBcc
in interface MailMessage
public String[] getBcc()
public void setSentDate(Date sentDate)
setSentDate
in interface MailMessage
public Date getSentDate()
public void setSubject(String subject)
setSubject
in interface MailMessage
public String getSubject()
public void setText(String text)
setText
in interface MailMessage
public String getText()
public void copyTo(MailMessage target)
target
- the MailMessage
to copy to