Package org.simplejavamail.mailer
Class MailerBuilder
java.lang.Object
org.simplejavamail.mailer.MailerBuilder
Entry builder used to start a
MailerGenericBuilder and fully configure a Mailer.
Any of these methods return a specialized builder, of which there are two:
- One to configure a Mailer using a custom
Sessioninstance - One to fully configure a Mailer which will produce its own
Sessioninstance
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.simplejavamail.api.mailer.MailerShortcuts toMailerRegularBuilder.buildMailer().static org.simplejavamail.mailer.internal.MailerFromSessionBuilderImplusingSession(@NotNull jakarta.mail.Session session) Delegates toMailerFromSessionBuilderImpl.usingSession(Session).static org.simplejavamail.mailer.internal.MailerRegularBuilderImplwithCustomMailer(org.simplejavamail.api.mailer.CustomMailer customMailer) Delegates toMailerGenericBuilder.withCustomMailer(CustomMailer).static org.simplejavamail.mailer.internal.MailerRegularBuilderImplwithDebugLogging(Boolean debugLogging) Delegates toMailerGenericBuilder.withDebugLogging(Boolean)static org.simplejavamail.mailer.internal.MailerRegularBuilderImplwithDebugOutput(org.simplejavamail.api.mailer.config.SessionDebugOutput debugOutput) Delegates toMailerGenericBuilder.withDebugOutput(SessionDebugOutput)static org.simplejavamail.mailer.internal.MailerRegularBuilderImplwithDebugPrinter(PrintStream debugPrinter) Delegates toMailerGenericBuilder.withDebugPrinter(PrintStream)static org.simplejavamail.mailer.internal.MailerRegularBuilderImplwithOAuth2AccessTokenProvider(@NotNull org.simplejavamail.api.mailer.config.OAuth2AccessTokenProvider accessTokenProvider) Delegates toMailerGenericBuilder.withOAuth2AccessTokenProvider(OAuth2AccessTokenProvider).static org.simplejavamail.mailer.internal.MailerRegularBuilderImplwithSMTPServer(@Nullable String host, @Nullable Integer port) Delegates toMailerRegularBuilder.withSMTPServer(String, Integer).static org.simplejavamail.mailer.internal.MailerRegularBuilderImplwithSMTPServer(@Nullable String host, @Nullable Integer port, @Nullable String username) Delegates toMailerRegularBuilder.withSMTPServer(String, Integer, String).static org.simplejavamail.mailer.internal.MailerRegularBuilderImplwithSMTPServer(@Nullable String host, @Nullable Integer port, @Nullable String username, @Nullable String password) Delegates toMailerRegularBuilder.withSMTPServer(String, Integer, String, String).static org.simplejavamail.mailer.internal.MailerRegularBuilderImplwithSMTPServerHost(@Nullable String host) Delegates toMailerRegularBuilder.withSMTPServerHost(String).static org.simplejavamail.mailer.internal.MailerRegularBuilderImplwithSMTPServerPassword(@Nullable String password) Delegates toMailerRegularBuilder.withSMTPServerPassword(String).static org.simplejavamail.mailer.internal.MailerRegularBuilderImplwithSMTPServerPort(@Nullable Integer port) Delegates toMailerRegularBuilder.withSMTPServerPort(Integer).static org.simplejavamail.mailer.internal.MailerRegularBuilderImplwithSMTPServerUsername(@Nullable String username) Delegates toMailerRegularBuilder.withSMTPServerUsername(String).static org.simplejavamail.mailer.internal.MailerRegularBuilderImplDelegates toMailerGenericBuilder.withTransportModeLoggingOnly(Boolean).static org.simplejavamail.mailer.internal.MailerRegularBuilderImplwithTransportStrategy(@NotNull org.simplejavamail.api.mailer.config.TransportStrategy transportStrategy) Delegates toMailerRegularBuilder.withTransportStrategy(TransportStrategy).
-
Method Details
-
usingSession
public static org.simplejavamail.mailer.internal.MailerFromSessionBuilderImpl usingSession(@NotNull @NotNull jakarta.mail.Session session) Delegates toMailerFromSessionBuilderImpl.usingSession(Session). -
withTransportStrategy
public static org.simplejavamail.mailer.internal.MailerRegularBuilderImpl withTransportStrategy(@NotNull @NotNull org.simplejavamail.api.mailer.config.TransportStrategy transportStrategy) Delegates toMailerRegularBuilder.withTransportStrategy(TransportStrategy). -
withOAuth2AccessTokenProvider
public static org.simplejavamail.mailer.internal.MailerRegularBuilderImpl withOAuth2AccessTokenProvider(@NotNull @NotNull org.simplejavamail.api.mailer.config.OAuth2AccessTokenProvider accessTokenProvider) Delegates toMailerGenericBuilder.withOAuth2AccessTokenProvider(OAuth2AccessTokenProvider). -
withSMTPServer
public static org.simplejavamail.mailer.internal.MailerRegularBuilderImpl withSMTPServer(@Nullable @Nullable String host, @Nullable @Nullable Integer port, @Nullable @Nullable String username, @Nullable @Nullable String password) Delegates toMailerRegularBuilder.withSMTPServer(String, Integer, String, String). -
withSMTPServer
public static org.simplejavamail.mailer.internal.MailerRegularBuilderImpl withSMTPServer(@Nullable @Nullable String host, @Nullable @Nullable Integer port, @Nullable @Nullable String username) Delegates toMailerRegularBuilder.withSMTPServer(String, Integer, String). -
withSMTPServer
public static org.simplejavamail.mailer.internal.MailerRegularBuilderImpl withSMTPServer(@Nullable @Nullable String host, @Nullable @Nullable Integer port) Delegates toMailerRegularBuilder.withSMTPServer(String, Integer). -
withSMTPServerHost
public static org.simplejavamail.mailer.internal.MailerRegularBuilderImpl withSMTPServerHost(@Nullable @Nullable String host) Delegates toMailerRegularBuilder.withSMTPServerHost(String). -
withSMTPServerPort
public static org.simplejavamail.mailer.internal.MailerRegularBuilderImpl withSMTPServerPort(@Nullable @Nullable Integer port) Delegates toMailerRegularBuilder.withSMTPServerPort(Integer). -
withSMTPServerUsername
public static org.simplejavamail.mailer.internal.MailerRegularBuilderImpl withSMTPServerUsername(@Nullable @Nullable String username) Delegates toMailerRegularBuilder.withSMTPServerUsername(String). -
withSMTPServerPassword
public static org.simplejavamail.mailer.internal.MailerRegularBuilderImpl withSMTPServerPassword(@Nullable @Nullable String password) Delegates toMailerRegularBuilder.withSMTPServerPassword(String). -
withDebugLogging
public static org.simplejavamail.mailer.internal.MailerRegularBuilderImpl withDebugLogging(Boolean debugLogging) Delegates toMailerGenericBuilder.withDebugLogging(Boolean)Note: Assumes you don't want to use your own
Sessionobject (otherwise start withusingSession(Session)instead). -
withDebugPrinter
public static org.simplejavamail.mailer.internal.MailerRegularBuilderImpl withDebugPrinter(PrintStream debugPrinter) Delegates toMailerGenericBuilder.withDebugPrinter(PrintStream)Note: Assumes you don't want to use your own
Sessionobject (otherwise start withusingSession(Session)instead). -
withDebugOutput
public static org.simplejavamail.mailer.internal.MailerRegularBuilderImpl withDebugOutput(org.simplejavamail.api.mailer.config.SessionDebugOutput debugOutput) Delegates toMailerGenericBuilder.withDebugOutput(SessionDebugOutput)Note: Assumes you don't want to use your own
Sessionobject (otherwise start withusingSession(Session)instead). -
withCustomMailer
public static org.simplejavamail.mailer.internal.MailerRegularBuilderImpl withCustomMailer(org.simplejavamail.api.mailer.CustomMailer customMailer) Delegates toMailerGenericBuilder.withCustomMailer(CustomMailer). -
withTransportModeLoggingOnly
public static org.simplejavamail.mailer.internal.MailerRegularBuilderImpl withTransportModeLoggingOnly()Delegates toMailerGenericBuilder.withTransportModeLoggingOnly(Boolean). -
buildMailer
public static org.simplejavamail.api.mailer.Mailer buildMailer()Shortcuts toMailerRegularBuilder.buildMailer(). This means that none of the builder methods are used and the configuration completely depends on defaults being configured from property file ("simplejavamail.properties") on the classpath or through programmatic defaults.
-