Class MailClient


  • public class MailClient
    extends Object
    SMTP mail client for Vert.x

    A simple asynchronous API for sending mails from Vert.x applications

    NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.

    • Constructor Detail

      • MailClient

        public MailClient​(io.vertx.ext.mail.MailClient delegate)
      • MailClient

        public MailClient​(Object delegate)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getDelegate

        public io.vertx.ext.mail.MailClient getDelegate()
      • create

        public static MailClient create​(Vertx vertx,
                                        io.vertx.ext.mail.MailConfig config)
        Create a non shared instance of the mail client.
        Parameters:
        vertx - the Vertx instance the operation will be run in
        config - MailConfig configuration to be used for sending mails
        Returns:
        MailClient instance that can then be used to send multiple mails
      • createShared

        public static MailClient createShared​(Vertx vertx,
                                              io.vertx.ext.mail.MailConfig config,
                                              String poolName)
        Create a Mail client which shares its connection pool with any other Mail clients created with the same pool name
        Parameters:
        vertx - the Vert.x instance
        config - the configuration
        poolName - the pool name
        Returns:
        the client
      • sendMail

        public MailClient sendMail​(io.vertx.ext.mail.MailMessage email,
                                   io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.mail.MailResult>> resultHandler)
        send a single mail via MailClient
        Parameters:
        email - MailMessage object containing the mail text, from/to, attachments etc
        resultHandler - will be called when the operation is finished or it fails (may be null to ignore the result)
        Returns:
        this MailClient instance so the method can be used fluently
      • sendMail

        public MailClient sendMail​(io.vertx.ext.mail.MailMessage email)
        send a single mail via MailClient
        Parameters:
        email - MailMessage object containing the mail text, from/to, attachments etc
        Returns:
        this MailClient instance so the method can be used fluently
      • rxSendMail

        public rx.Single<io.vertx.ext.mail.MailResult> rxSendMail​(io.vertx.ext.mail.MailMessage email)
        send a single mail via MailClient
        Parameters:
        email - MailMessage object containing the mail text, from/to, attachments etc
        Returns:
        this MailClient instance so the method can be used fluently
      • close

        public void close​(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> closedHandler)
        Close the MailClient
        Parameters:
        closedHandler - will be called after it is closed.
      • close

        public void close()
        Close the MailClient
      • rxClose

        public rx.Single<Void> rxClose()
        Close the MailClient
        Returns:
      • newInstance

        public static MailClient newInstance​(io.vertx.ext.mail.MailClient arg)