io.vertx.ext.mail

## Interface MailClient

- All Known Subinterfaces:
    MailService
  All Known Implementing Classes:
    MailServiceVertxEBProxy

      public interface MailClient

  SMTP mail client for Vert.x

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

  Author:
    Alexander Lehmann

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_POOL_NAME` The name of the default pool

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` close the MailClient
    `static MailClient` | `createNonShared(Vertx vertx, MailConfig config)` create a non shared instance of the mail client
    `static MailClient` | `createShared(Vertx vertx, MailConfig config)` Like `createShared(io.vertx.core.Vertx, MailConfig, String)` but with the default pool name
    `static MailClient` | `createShared(Vertx vertx, MailConfig config, String poolName)` Create a Mail client which shares its data source with any other Mongo clients created with the same pool name
    `MailClient` | `sendMail(MailMessage email, Handler<AsyncResult<MailResult>> resultHandler)` send a single mail via MailClient

- - ### Field Detail

    - #### DEFAULT_POOL_NAME

          static final String DEFAULT_POOL_NAME

      The name of the default pool
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### createNonShared

          static MailClient createNonShared(Vertx vertx,
                                            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

          static MailClient createShared(Vertx vertx,
                                         MailConfig config,
                                         String poolName)

      Create a Mail client which shares its data source with any other Mongo clients created with the same pool name
      Parameters:
        `vertx` - the Vert.x instance
        `config` - the configuration
        `poolName` - the pool name
      Returns:
        the client

    - #### createShared

          static MailClient createShared(Vertx vertx,
                                         MailConfig config)

      Like `createShared(io.vertx.core.Vertx, MailConfig, String)` but with the default pool name
      Parameters:
        `vertx` - the Vert.x instance
        `config` - the configuration
      Returns:
        the client

    - #### sendMail

          MailClient sendMail(MailMessage email,
                              Handler<AsyncResult<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

    - #### close

          void close()

      close the MailClient

Copyright © 2016. All rights reserved.