public class RecordingMailSender extends ConsoleWritingMailSender
MailSender
implementation that allows looking up all SimpleMailMessage
s 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
SimpleMailMessage s that have been recorded so far. |
void |
send(org.springframework.mail.SimpleMailMessage simpleMessage) |
send
public void send(org.springframework.mail.SimpleMailMessage simpleMessage) throws org.springframework.mail.MailException
send
in interface org.springframework.mail.MailSender
send
in class ConsoleWritingMailSender
org.springframework.mail.MailException
public Streamable<org.springframework.mail.SimpleMailMessage> getSentMessages()
SimpleMailMessage
s that have been recorded so far.Copyright © 2018 Pivotal Software, Inc.. All rights reserved.