- java.lang.Object
-
- com.appslandia.common.base.InitializeObject
-
- com.appslandia.common.mail.SmtpMailer
-
- All Implemented Interfaces:
InitializeSupport
public class SmtpMailer extends InitializeObject
- Author:
- Loc Ha
-
-
Field Summary
Fields Modifier and Type Field Description protected SecurePropspropsprotected jakarta.mail.Sessionsession
-
Constructor Summary
Constructors Constructor Description SmtpMailer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidinit()MailerMessagenewMessage()voidsend(MailerMessage message)voidsend(List<MailerMessage> messages)voidsendAsync(MailerMessage message, Executor executor, Consumer<Exception> consumer)voidsendAsync(List<MailerMessage> messages, Executor executor, Consumer<Exception> consumer)SmtpMailersetProps(SecureProps props)-
Methods inherited from class com.appslandia.common.base.InitializeObject
assertNotInitialized, destroy, initialize
-
-
-
-
Field Detail
-
props
protected SecureProps props
-
session
protected jakarta.mail.Session session
-
-
Method Detail
-
init
protected void init() throws Exception- Specified by:
initin classInitializeObject- Throws:
Exception
-
newMessage
public MailerMessage newMessage() throws jakarta.mail.internet.AddressException
- Throws:
jakarta.mail.internet.AddressException
-
send
public void send(MailerMessage message) throws jakarta.mail.MessagingException
- Throws:
jakarta.mail.MessagingException
-
send
public void send(List<MailerMessage> messages) throws jakarta.mail.MessagingException
- Throws:
jakarta.mail.MessagingException
-
sendAsync
public void sendAsync(MailerMessage message, Executor executor, Consumer<Exception> consumer)
-
sendAsync
public void sendAsync(List<MailerMessage> messages, Executor executor, Consumer<Exception> consumer)
-
setProps
public SmtpMailer setProps(SecureProps props)
-
-