Top Description Methods
org.springframework.mail

public Interface MailSender

Known Direct Subinterfaces
org.springframework.mail.javamail.JavaMailSender

This interface defines a strategy for sending simple mails. Can be implemented for a variety of mailing systems due to the simple requirements. For richer functionality like MIME messages, consider JavaMailSender.

Allows for easy testing of clients, as it does not depend on JavaMail's infrastructure classes: no mocking of JavaMail Session or Transport necessary.

Authors
Dmitriy Kopylenko, Juergen Hoeller
Since
10.09.2003
See Also
org.springframework.mail.javamail.JavaMailSender

Method Summary

Modifier and TypeMethod and Description
public default void
send(SimpleMailMessage
the message to send
simpleMessage
)

Send the given simple mail message.

public void
send(SimpleMailMessage...
the messages to send
simpleMessages
)

Send the given array of simple mail messages in batch.

Method Detail

sendback to summary
public default void send(SimpleMailMessage simpleMessage) throws MailException

Send the given simple mail message.

Parameters
simpleMessage:SimpleMailMessage

the message to send

Exceptions
MailParseException:
in case of failure when parsing the message
MailAuthenticationException:
in case of authentication failure
MailSendException:
in case of failure when sending the message
sendback to summary
public void send(SimpleMailMessage... simpleMessages) throws MailException

Send the given array of simple mail messages in batch.

Parameters
simpleMessages:SimpleMailMessage[]

the messages to send

Exceptions
MailParseException:
in case of failure when parsing a message
MailAuthenticationException:
in case of authentication failure
MailSendException:
in case of failure when sending a message