public class MailSendingMessageHandler extends AbstractMessageHandler
MessageHandler
implementation for sending mail.
If the Message is an instance of MailMessage
, it will be passed
as-is. If the Message payload is a byte array, it will be passed as an
attachment, and in that case, the MailHeaders.ATTACHMENT_FILENAME
header is required. Otherwise, a String type is expected, and its content
will be used as the text within a SimpleMailMessage
.
MailHeaders
logger
Constructor and Description |
---|
MailSendingMessageHandler(org.springframework.mail.javamail.JavaMailSender mailSender)
Create a MailSendingMessageConsumer.
|
Modifier and Type | Method and Description |
---|---|
protected void |
handleMessageInternal(Message<?> message) |
getComponentType, getOrder, handleMessage, setOrder, setShouldTrack
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getTaskScheduler, onInit, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponentName
public MailSendingMessageHandler(org.springframework.mail.javamail.JavaMailSender mailSender)
mailSender
- the JavaMailSender
instance to which this
adapter will delegate.protected final void handleMessageInternal(Message<?> message)
handleMessageInternal
in class AbstractMessageHandler