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>
Since:
1.0.0
Author:
Sergio del Amo
  • Field Details

  • Constructor Details

    • JavaxEmailSender

      public JavaxEmailSender(@Named("io") ExecutorService executorService, JavaxEmailComposer javaxEmailComposer)
      Parameters:
      executorService - Executor service
      javaxEmailComposer - Message Composer
  • Method Details

    • getName

      @NonNull public @NonNull String 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 - Email
      emailRequest - Email Request Consumer
      Returns:
      Response Object or empty optional if an error occurred
      Throws:
      EmailException - Wrapper of any exception thrown while sending email