public class MailSendingMessageHandler
extends org.springframework.integration.handler.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
Constructor and Description |
---|
MailSendingMessageHandler(org.springframework.mail.javamail.JavaMailSender mailSender)
Create a MailSendingMessageConsumer.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getComponentType() |
protected void |
handleMessageInternal(org.springframework.messaging.Message<?> message) |
getOrder, handleMessage, setOrder, setShouldTrack
afterPropertiesSet, getApplicationContext, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, onInit, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toString
public MailSendingMessageHandler(org.springframework.mail.javamail.JavaMailSender mailSender)
mailSender
- the JavaMailSender
instance to which this
adapter will delegate.public java.lang.String getComponentType()
getComponentType
in interface org.springframework.integration.support.context.NamedComponent
getComponentType
in class org.springframework.integration.handler.AbstractMessageHandler
protected final void handleMessageInternal(org.springframework.messaging.Message<?> message)
handleMessageInternal
in class org.springframework.integration.handler.AbstractMessageHandler