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 MimeMessageSenderprotected org.springframework.mail.javamail.JavaMailSenderImpl createSender(Map<ApplicationPropertyMailing,String> settings)
public void send(javax.mail.internet.MimeMessage message)
throws MailingException
MimeMessageSendersend in interface MimeMessageSendermessage - the message to sendMailingException - in case sending failedprotected void testConnection(org.springframework.mail.javamail.JavaMailSenderImpl sender)
throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic boolean testSettings(Map<ApplicationPropertyMailing,String> settings)
MimeMessageSendertestSettings in interface MimeMessageSendersettings - the configuration to testpublic boolean testSettings(Map<ApplicationPropertyMailing,String> settings, javax.mail.internet.MimeMessage testMessage)
MimeMessageSendertestSettings in interface MimeMessageSendersettings - 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)
MimeMessageSenderMimeMessageSender.send(MimeMessage). Implementations don't need to validate the
settings.updateSettings in interface MimeMessageSendersettings - the new settingsCopyright © 2019 Communote team. All rights reserved.