接口 MailSender
- 所有已知子接口:
JavaMailSender
- 所有已知实现类:
JavaMailSenderImpl
public interface MailSender
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.
- 从以下版本开始:
- 4.0
- 作者:
- Dmitriy Kopylenko, Juergen Hoeller, Harry Yang
- 另请参阅:
-
方法概要
修饰符和类型方法说明voidsend(SimpleMailMessage simpleMessage) Send the given simple mail message.voidsend(SimpleMailMessage... simpleMessages) Send the given array of simple mail messages in batch.
-
方法详细资料
-
send
Send the given simple mail message.- 参数:
simpleMessage- the message to send- 抛出:
MailParseException- in case of failure when parsing the messageMailAuthenticationException- in case of authentication failureMailSendException- in case of failure when sending the messageMailException
-
send
Send the given array of simple mail messages in batch.- 参数:
simpleMessages- the messages to send- 抛出:
MailParseException- in case of failure when parsing a messageMailAuthenticationException- in case of authentication failureMailSendException- in case of failure when sending a messageMailException
-