public class GmailSmtpEmailSender extends SmtpAuthEmailSender
| Constructor and Description |
|---|
GmailSmtpEmailSender(java.lang.String username,
java.lang.String password,
java.util.concurrent.Executor executor,
int timeoutMs)
Create an e-mail sender that connects to smtp.gmail.com:587 using (and requiring)
SmtpConfiguration.TransportSecurity.STARTTLS security. |
createAndFillMessage, createSession, properties, send, sendMessagepublic GmailSmtpEmailSender(@Nonnull
java.lang.String username,
@Nonnull
java.lang.String password,
@Nonnull
java.util.concurrent.Executor executor,
int timeoutMs)
SmtpConfiguration.TransportSecurity.STARTTLS security.
See SmtpAuthEmailSender.SmtpAuthEmailSender(SmtpConfiguration, Executor, int)
for details on how to configure this service.
username - the complete Gmail e-mail addresspassword - the Gmail passwordexecutor - the executor to use, e.g. ForkJoinPool.commonPool() may be used,
but see SmtpAuthEmailSender.SmtpAuthEmailSender(SmtpConfiguration, Executor, int)
for detailstimeoutMs - the timeout for creating, reading from and writing to SMTP connections in
milliseconds. To try out GmailSmtpEmailSender for a low to moderate traffic site,
10*1000ms might fit. But see
SmtpAuthEmailSender.SmtpAuthEmailSender(SmtpConfiguration, Executor, int) on what to
consider when choosing a timeout for use in a production environment.