@Component public class MailPublisher extends Object
| Constructor and Description |
|---|
MailPublisher() |
| Modifier and Type | Method and Description |
|---|---|
String |
getDefaultMailSender() |
org.springframework.mail.javamail.JavaMailSender |
getMailSender() |
void |
sendMail(javax.mail.internet.MimeMessage mimeMessage) |
void |
sendMail(org.springframework.mail.SimpleMailMessage mailMessage) |
void |
sendMail(String from,
String replyTo,
String[] to,
String[] cc,
String[] bcc,
String subject,
String msg)
Sends a SimpleMailMessage.
|
void |
sendMimeMail(String from,
String replyTo,
String[] to,
String[] cc,
String[] bcc,
String subject,
String msg,
Boolean html,
String attachmentFilename,
File attachmentFile)
Sends a MimeMessage.
|
void |
setDefaultMailSender(String defaultMailSender) |
void |
setMailSender(org.springframework.mail.javamail.JavaMailSender mailSender) |
public void sendMail(String from, String replyTo, String[] to, String[] cc, String[] bcc, String subject, String msg) throws Exception
from - The mail sender address.replyTo - The reply to address.to - A list of mail recipient addresses.cc - A list of carbon copy mail recipient addresses.bcc - A list of blind carbon copy mail recipient addresses.subject - The mail subject.msg - The mail message text.Exceptionpublic void sendMimeMail(String from, String replyTo, String[] to, String[] cc, String[] bcc, String subject, String msg, Boolean html, String attachmentFilename, File attachmentFile) throws javax.mail.MessagingException, org.springframework.mail.MailException
from - The mail sender address.replyTo - The reply to address.to - A list of mail recipient addresses.cc - A list of carbon copy mail recipient addresses.bcc - A list of blind carbon copy mail recipient addresses.subject - The mail subject.msg - The mail message text.html - Whether to apply content type "text/html" or the default
content type ("text/plain").attachmentFilename - The attachment file name.attachmentFile - The file resource to be applied to the mail.javax.mail.MessagingExceptionorg.springframework.mail.MailExceptionpublic void sendMail(org.springframework.mail.SimpleMailMessage mailMessage)
throws org.springframework.mail.MailException
mailMessage - org.springframework.mail.MailExceptionpublic void sendMail(javax.mail.internet.MimeMessage mimeMessage)
throws org.springframework.mail.MailException,
javax.mail.MessagingException
mimeMessage - javax.mail.MessagingExceptionorg.springframework.mail.MailExceptionpublic org.springframework.mail.javamail.JavaMailSender getMailSender()
public void setMailSender(org.springframework.mail.javamail.JavaMailSender mailSender)
mailSender - the mailSender to setpublic String getDefaultMailSender()
public void setDefaultMailSender(String defaultMailSender)
defaultMailSender - the defaultMailSender to setCopyright © 2020 terrestris GmbH & Co. KG. All rights reserved.