public class RecordingMailSender extends ConsoleWritingMailSender
MailSender implementation that allows looking up all SimpleMailMessages that have been sent. Will
also log the messages as they are received for sending. The required setup steps can be found in
ConsoleWritingMailSender's JavaDoc.| Constructor and Description |
|---|
RecordingMailSender() |
| Modifier and Type | Method and Description |
|---|---|
Streamable<org.springframework.mail.SimpleMailMessage> |
getSentMessages()
Returns all
SimpleMailMessages that have been recorded so far. |
void |
send(org.springframework.mail.SimpleMailMessage simpleMessage) |
sendpublic void send(org.springframework.mail.SimpleMailMessage simpleMessage)
throws org.springframework.mail.MailException
send in interface org.springframework.mail.MailSendersend in class ConsoleWritingMailSenderorg.springframework.mail.MailExceptionpublic Streamable<org.springframework.mail.SimpleMailMessage> getSentMessages()
SimpleMailMessages that have been recorded so far.Copyright © 2018 Pivotal Software, Inc.. All rights reserved.