public class LoggingMailSender
extends org.springframework.mail.javamail.JavaMailSenderImpl
A mail sender implementation that just logs outgoing messages instead of actually sending them.
Constructor and Description |
---|
LoggingMailSender() |
Modifier and Type | Method and Description |
---|---|
javax.mail.internet.MimeMessage |
getLastMessage()
Get the last message sent.
|
int |
getMessageCount()
Get the number of messages sent since the instance was created or reset.
|
void |
reset()
Reset the message tracking.
|
void |
send(javax.mail.internet.MimeMessage message) |
void |
testConnection() |
createMimeMessage, createMimeMessage, getDefaultEncoding, getDefaultFileTypeMap, getHost, getJavaMailProperties, getPassword, getPort, getProtocol, getSession, getUsername, send, send, send, send, send, setDefaultEncoding, setDefaultFileTypeMap, setHost, setJavaMailProperties, setPassword, setPort, setProtocol, setSession, setUsername
public void send(javax.mail.internet.MimeMessage message)
send
in interface org.springframework.mail.javamail.JavaMailSender
send
in class org.springframework.mail.javamail.JavaMailSenderImpl
public javax.mail.internet.MimeMessage getLastMessage()
Get the last message sent.
null
if no messages were sent)public int getMessageCount()
Get the number of messages sent since the instance was created or reset.
public void reset()
Reset the message tracking.
public void testConnection() throws javax.mail.MessagingException
testConnection
in class org.springframework.mail.javamail.JavaMailSenderImpl
javax.mail.MessagingException
Copyright © 2010 - 2019 edorasware ag. All Rights Reserved.