接口 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.
- 从以下版本开始:
- 10.09.2003
- 作者:
- Dmitriy Kopylenko, Juergen Hoeller
- 另请参阅:
JavaMailSender
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 void
send(SimpleMailMessage simpleMessage)
Send the given simple mail message.void
send(SimpleMailMessage... simpleMessages)
Send the given array of simple mail messages in batch.
方法详细资料
send
void send(SimpleMailMessage simpleMessage) throws MailException
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
void send(SimpleMailMessage... simpleMessages) throws MailException
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