Constructor and Description |
---|
StandardEmailer(MailSettings mailSettings) |
Modifier and Type | Method and Description |
---|---|
void |
send(MailInfo mail) |
void |
sendEmail(MailInfo mailInfo)
Sends an email to the email addresses provided in the
MailInfo , using the sender from the passed in MailInfo ,
or if not provided, the one in MailSettings . |
void |
sendEmail(java.lang.String subject,
java.util.List<java.lang.String> mailTo,
java.lang.String message)
Sends an email to a collection of email addresses, using the sender from
MailSettings |
void |
sendEmail(java.lang.String subject,
java.lang.String mailTo,
java.lang.String message)
Sends an email to a single email address, using the sender from
MailSettings |
@Autowired public StandardEmailer(MailSettings mailSettings)
public void sendEmail(java.lang.String subject, java.lang.String mailTo, java.lang.String message) throws javax.mail.MessagingException
MailSettings
sendEmail
in interface Emailer
subject
- the subject of the email to be sentmailTo
- the email address to which we want to send the emailmessage
- the content/body of the email to be sentjavax.mail.MessagingException
- when the email is malformed or SMTP setup is not correct.public void sendEmail(java.lang.String subject, java.util.List<java.lang.String> mailTo, java.lang.String message) throws javax.mail.MessagingException
MailSettings
sendEmail
in interface Emailer
subject
- the subject of the email to be sentmailTo
- the email addresses to which we want to send the emailmessage
- the content/body of the email to be sentjavax.mail.MessagingException
- when the email is malformed or SMTP setup is not correct.public void sendEmail(MailInfo mailInfo) throws javax.mail.MessagingException
MailInfo
, using the sender from the passed in MailInfo
,
or if not provided, the one in MailSettings
. Provides much more functionality than
either Emailer.sendEmail(String, List, String)
or Emailer.sendEmail(String, String, String)
public void send(MailInfo mail) throws javax.mail.MessagingException
javax.mail.MessagingException