Skip navigation links

Package com.hubspot.smtp.client

This package contains classes to create and maintain connections to SMTP servers.

See: Description

Package com.hubspot.smtp.client Description

This package contains classes to create and maintain connections to SMTP servers.

To connect to a remote server:

  1. Create a SmtpSessionFactoryConfig to define application-wide settings
  2. Pass this to the SmtpSessionFactory constructor to create a factory
  3. Create a SmtpSessionConfig to specify the address of a remote server
  4. Call SmtpSessionFactory.connect(com.hubspot.smtp.client.SmtpSessionConfig) with this configuration

Once you have an active session, you can send emails:

  1. Initialise the connection by calling SmtpSession.send(io.netty.handler.codec.smtp.SmtpRequest) with an EHLO command
  2. Optionally enable TLS encryption by calling SmtpSession.startTls() if TLS is supported
  3. Send an email by calling SmtpSession.send(java.lang.String, java.lang.String, com.hubspot.smtp.messages.MessageContent) or one of its overloads.
Skip navigation links

Copyright © 2018. All rights reserved.