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(@Nullable String from)
setFrom
in interface MailMessage
public void setReplyTo(@Nullable String replyTo)
setReplyTo
in interface MailMessage
public void setTo(@Nullable String to)
setTo
in interface MailMessage
public void setTo(String... to)
setTo
in interface MailMessage
public void setCc(@Nullable String cc)
setCc
in interface MailMessage
public void setCc(@Nullable String... cc)
setCc
in interface MailMessage
public void setBcc(@Nullable String bcc)
setBcc
in interface MailMessage
public void setBcc(@Nullable String... bcc)
setBcc
in interface MailMessage
public void setSentDate(@Nullable Date sentDate)
setSentDate
in interface MailMessage
public void setSubject(@Nullable String subject)
setSubject
in interface MailMessage
public void setText(@Nullable String text)
setText
in interface MailMessage
public void copyTo(MailMessage target)
target
- the MailMessage
to copy to