public class SmtpMimeMessageSender extends Object implements MimeMessageSender
Constructor and Description |
---|
SmtpMimeMessageSender(Map<ApplicationPropertyMailing,String> settings) |
Modifier and Type | Method and Description |
---|---|
javax.mail.internet.MimeMessage |
createMimeMessage() |
protected org.springframework.mail.javamail.JavaMailSenderImpl |
createSender(Map<ApplicationPropertyMailing,String> settings) |
void |
send(javax.mail.internet.MimeMessage message)
Send the mime message.
|
protected void |
testConnection(org.springframework.mail.javamail.JavaMailSenderImpl sender) |
boolean |
testSettings(Map<ApplicationPropertyMailing,String> settings)
Test the new configuration for sending mime messages.
|
boolean |
testSettings(Map<ApplicationPropertyMailing,String> settings,
javax.mail.internet.MimeMessage testMessage)
Test the new configuration for sending mime messages and send a test message.
|
void |
updateSettings(Map<ApplicationPropertyMailing,String> settings)
Update the configuration of this mime message sender so that it will be used in subsequent
invocations of
MimeMessageSender.send(MimeMessage) . |
public SmtpMimeMessageSender(Map<ApplicationPropertyMailing,String> settings)
public javax.mail.internet.MimeMessage createMimeMessage()
createMimeMessage
in interface MimeMessageSender
protected org.springframework.mail.javamail.JavaMailSenderImpl createSender(Map<ApplicationPropertyMailing,String> settings)
public void send(javax.mail.internet.MimeMessage message) throws MailingException
MimeMessageSender
send
in interface MimeMessageSender
message
- the message to sendMailingException
- in case sending failedprotected void testConnection(org.springframework.mail.javamail.JavaMailSenderImpl sender) throws javax.mail.MessagingException
javax.mail.MessagingException
public boolean testSettings(Map<ApplicationPropertyMailing,String> settings)
MimeMessageSender
testSettings
in interface MimeMessageSender
settings
- the configuration to testpublic boolean testSettings(Map<ApplicationPropertyMailing,String> settings, javax.mail.internet.MimeMessage testMessage)
MimeMessageSender
testSettings
in interface MimeMessageSender
settings
- the configuration to testtestMessage
- a test message to send. Can be null. In this case the method should behave like
MimeMessageSender.testSettings(Map)
.public void updateSettings(Map<ApplicationPropertyMailing,String> settings)
MimeMessageSender
MimeMessageSender.send(MimeMessage)
. Implementations don't need to validate the
settings.updateSettings
in interface MimeMessageSender
settings
- the new settingsCopyright © 2019 Communote team. All rights reserved.