public class FileSystemMimeMessageSender extends Object implements MimeMessageSender
Modifier and Type | Field and Description |
---|---|
static String |
MESSAGE_STORAGE_SUB_DIR |
Constructor and Description |
---|
FileSystemMimeMessageSender(boolean messageIdBasedFilename) |
Modifier and Type | Method and Description |
---|---|
javax.mail.internet.MimeMessage |
createMimeMessage() |
void |
send(javax.mail.internet.MimeMessage message)
Send the mime message.
|
boolean |
testSettings(Map<ApplicationPropertyMailing,String> settings)
Test the new configuration for sending mime messages.
|
boolean |
testSettings(Map<ApplicationPropertyMailing,String> settings,
javax.mail.internet.MimeMessage message)
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 static final String MESSAGE_STORAGE_SUB_DIR
public FileSystemMimeMessageSender(boolean messageIdBasedFilename)
messageIdBasedFilename
- whether to create file name from message ID or the subjectpublic javax.mail.internet.MimeMessage createMimeMessage()
createMimeMessage
in interface MimeMessageSender
public void send(javax.mail.internet.MimeMessage message) throws org.springframework.mail.MailException
MimeMessageSender
send
in interface MimeMessageSender
message
- the message to sendorg.springframework.mail.MailException
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 message)
MimeMessageSender
testSettings
in interface MimeMessageSender
settings
- the configuration to testmessage
- 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.