Class JavaxEmailSender
java.lang.Object
io.micronaut.email.AbstractTransactionalEmailSender<jakarta.mail.Message,Void>
io.micronaut.email.javamail.sender.JavaxEmailSender
- All Implemented Interfaces:
io.micronaut.core.naming.Named
,AsyncTransactionalEmailSender<jakarta.mail.Message,
,Void> TransactionalEmailSender<jakarta.mail.Message,
Void>
@Named("javaxmail")
@Secondary
@Singleton
@Requires(beans={SessionProvider.class,MessageComposer.class})
public class JavaxEmailSender
extends AbstractTransactionalEmailSender<jakarta.mail.Message,Void>
Java Mail implementation of
TransactionalEmailSender
and AsyncTransactionalEmailSender
.- Since:
- 1.0.0
- Author:
- Sergio del Amo
-
Field Summary
-
Constructor Summary
ConstructorDescriptionJavaxEmailSender
(ExecutorService executorService, JavaxEmailComposer javaxEmailComposer) -
Method Summary
Methods inherited from class io.micronaut.email.AbstractTransactionalEmailSender
sendAsync
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.email.AsyncTransactionalEmailSender
sendAsync
Methods inherited from interface io.micronaut.email.TransactionalEmailSender
send
-
Field Details
-
NAME
JavaxEmailSender
name.- See Also:
-
-
Constructor Details
-
JavaxEmailSender
public JavaxEmailSender(@Named("io") ExecutorService executorService, JavaxEmailComposer javaxEmailComposer) - Parameters:
executorService
- Executor servicejavaxEmailComposer
- Message Composer
-
-
Method Details
-
getName
-
send
@NonNull public @NonNull Void send(@NonNull @NotNull @Valid @NonNull @NotNull @Valid Email email, @NonNull @NotNull @NonNull @NotNull Consumer<jakarta.mail.Message> emailRequest) throws EmailException Description copied from interface:TransactionalEmailSender
Sends an email.- Parameters:
email
- EmailemailRequest
- Email Request Consumer- Returns:
- Response Object or empty optional if an error occurred
- Throws:
EmailException
- Wrapper of any exception thrown while sending email
-