Package org.springframework.mail
Class SimpleMailMessage
java.lang.Object
org.springframework.mail.SimpleMailMessage
- All Implemented Interfaces:
Serializable
,MailMessage
Models a simple mail message, including data such as the from, to, cc, subject,
and text fields.
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.
- Since:
- 10.09.2003
- Author:
- Dmitriy Kopylenko, Juergen Hoeller
- See Also:
-
Constructor Summary
ConstructorDescriptionCreate a newSimpleMailMessage
.SimpleMailMessage
(SimpleMailMessage original) Copy constructor for creating a newSimpleMailMessage
from the state of an existingSimpleMailMessage
instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
copyTo
(MailMessage target) Copy the contents of this message to the given target message.boolean
String[]
getBcc()
String[]
getCc()
getFrom()
getText()
String[]
getTo()
int
hashCode()
void
void
void
void
void
void
setReplyTo
(String replyTo) void
setSentDate
(Date sentDate) void
setSubject
(String subject) void
void
void
toString()
-
Constructor Details
-
SimpleMailMessage
public SimpleMailMessage()Create a newSimpleMailMessage
. -
SimpleMailMessage
Copy constructor for creating a newSimpleMailMessage
from the state of an existingSimpleMailMessage
instance.
-
-
Method Details
-
setFrom
- Specified by:
setFrom
in interfaceMailMessage
-
getFrom
-
setReplyTo
- Specified by:
setReplyTo
in interfaceMailMessage
-
getReplyTo
-
setTo
- Specified by:
setTo
in interfaceMailMessage
-
setTo
- Specified by:
setTo
in interfaceMailMessage
-
getTo
-
setCc
- Specified by:
setCc
in interfaceMailMessage
-
setCc
- Specified by:
setCc
in interfaceMailMessage
-
getCc
-
setBcc
- Specified by:
setBcc
in interfaceMailMessage
-
setBcc
- Specified by:
setBcc
in interfaceMailMessage
-
getBcc
-
setSentDate
- Specified by:
setSentDate
in interfaceMailMessage
-
getSentDate
-
setSubject
- Specified by:
setSubject
in interfaceMailMessage
-
getSubject
-
setText
- Specified by:
setText
in interfaceMailMessage
-
getText
-
copyTo
Copy the contents of this message to the given target message.- Parameters:
target
- theMailMessage
to copy to
-
equals
-
hashCode
public int hashCode() -
toString
-