Package io.vertx.reactivex.ext.mail

## Class MailClient

- java.lang.Object
- - io.vertx.reactivex.ext.mail.MailClient

- All Implemented Interfaces:
    `io.vertx.lang.rx.RxDelegate`

      public class MailClient
      extends Object
      implements io.vertx.lang.rx.RxDelegate

  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.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static io.vertx.lang.rx.TypeArg<MailClient>` | `__TYPE_ARG` |
    `static String` | `DEFAULT_POOL_NAME` | The name of the default pool

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MailClient​(MailClient delegate)` |
    `MailClient​(Object delegate)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static MailClientBuilder` | `builder​(Vertx vertx)` | Provide a builder for `MailClient`.
    `Future<Void>` | `close()` | Close the MailClient
    `static MailClient` | `create​(Vertx vertx, MailConfig config)` | Create a non shared instance of the mail client.
    `static MailClient` | `createShared​(Vertx vertx, MailConfig config)` | Like `createShared(io.vertx.reactivex.core.Vertx, io.vertx.ext.mail.MailConfig, java.lang.String)` but with the default pool name
    `static MailClient` | `createShared​(Vertx vertx, MailConfig config, String poolName)` | Create a Mail client which shares its connection pool with any other Mail clients created with the same pool name
    `boolean` | `equals​(Object o)` |
    `MailClient` | `getDelegate()` |
    `int` | `hashCode()` |
    `static MailClient` | `newInstance​(MailClient arg)` |
    `Completable` | `rxClose()` | Close the MailClient
    `Single<MailResult>` | `rxSendMail​(MailMessage email)` | send a single mail via MailClient
    `Future<MailResult>` | `sendMail​(MailMessage email)` | send a single mail via MailClient
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<MailClient> __TYPE_ARG

    - #### DEFAULT_POOL_NAME

          public static final String DEFAULT_POOL_NAME

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

  - ### Constructor Detail

    - #### MailClient

          public MailClient​(MailClient delegate)

    - #### MailClient

          public MailClient​(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals​(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public MailClient getDelegate()

      Specified by:
        `getDelegate` in interface `io.vertx.lang.rx.RxDelegate`

    - #### builder

          public static MailClientBuilder builder​(Vertx vertx)

      Provide a builder for `MailClient`.

      It can be used to configure advanced settings like changing credentials with `MailClientBuilder.withCredentialsSupplier(java.util.function.Supplier<io.vertx.core.Future<io.vertx.ext.auth.authentication.UsernamePasswordCredentials>>)`.

      Parameters:
        `vertx` -
      Returns:

    - #### create

          public static MailClient create​(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

          public static MailClient createShared​(Vertx vertx,
                                                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

    - #### createShared

          public static MailClient createShared​(Vertx vertx,
                                                MailConfig config)

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

    - #### sendMail

          public Future<MailResult> sendMail​(MailMessage email)

      send a single mail via MailClient
      Parameters:
        `email` - MailMessage object containing the mail text, from/to, attachments etc
      Returns:
        a future notified when the operation is finished or it fails (may be null to ignore the result)

    - #### rxSendMail

          public Single<MailResult> rxSendMail​(MailMessage email)

      send a single mail via MailClient
      Parameters:
        `email` - MailMessage object containing the mail text, from/to, attachments etc
      Returns:
        a future notified when the operation is finished or it fails (may be null to ignore the result)

    - #### close

          public Future<Void> close()

      Close the MailClient
      Returns:

    - #### rxClose

          public Completable rxClose()

      Close the MailClient
      Returns:

    - #### newInstance

          public static MailClient newInstance​(MailClient arg)