Package: io.vertx.groovy.ext.mail

## [Groovy] Class MailClient

- io.vertx.groovy.ext.mail.MailClient

- SMTP mail client for Vert.x

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

- - ### Constructor Summary

    Constructors
    Constructor and description
    `MailClient (Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `close()` close the MailClient
    `static MailClient` | `createNonShared(Vertx vertx, Map<String, Object> config)` create a non shared instance of the mail client
    `static MailClient` | `createShared(Vertx vertx, Map<String, Object> config, String poolName)` Create a Mail client which shares its data source with any other Mongo clients created with the same pool name
    `static MailClient` | `createShared(Vertx vertx, Map<String, Object> config)` Like MailClient.createShared but with the default pool name
    `Object` | `getDelegate()`
    `MailClient` | `sendMail(Map<String, Object> email = [:], Handler<AsyncResult<Map<String, Object>>> resultHandler)` send a single mail via MailClient

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

    - #### MailClient(Object delegate)

  - ### Method Detail

    - #### void close()

      close the MailClient

    - #### static MailClient createNonShared(Vertx vertx, Map<String, Object> config)

      create a non shared instance of the mail client

      Returns:
        MailClient instance that can then be used to send multiple mails
      Parameters:
        `vertx` - the Vertx instance the operation will be run in
        `config` - MailConfig configuration to be used for sending mails (see MailConfig)

    - #### static MailClient createShared(Vertx vertx, Map<String, Object> config, String poolName)

      Create a Mail client which shares its data source with any other Mongo clients created with the same pool name

      Returns:
        the client
      Parameters:
        `vertx` - the Vert.x instance
        `config` - the configuration (see MailConfig)
        `poolName` - the pool name

    - #### static MailClient createShared(Vertx vertx, Map<String, Object> config)

      Like MailClient.createShared but with the default pool name

      Returns:
        the client
      Parameters:
        `vertx` - the Vert.x instance
        `config` - the configuration (see MailConfig)

    - #### Object getDelegate()

    - #### MailClient sendMail(Map<String, Object> email = [:], Handler<AsyncResult<Map<String, Object>>> resultHandler)

      send a single mail via MailClient

      Returns:
        this MailClient instance so the method can be used fluently
      Parameters:
        `email` - MailMessage object containing the mail text, from/to, attachments etc (see MailMessage)
        `resultHandler` - will be called when the operation is finished or it fails (may be null to ignore the result)