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 (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `close()` close the MailClient
    `static MailClient` | `createNonShared(Vertx vertx, java.util.Map<java.lang.String, java.lang.Object> config)` create a non shared instance of the mail client
    `static MailClient` | `createShared(Vertx vertx, java.util.Map<java.lang.String, java.lang.Object> config, java.lang.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, java.util.Map<java.lang.String, java.lang.Object> config)` Like MailClient.createShared but with the default pool name
    `java.lang.Object` | `getDelegate()`
    `MailClient` | `sendMail(java.util.Map<java.lang.String, java.lang.Object> email = [:], io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.Object>>> resultHandler)` send a single mail via MailClient

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### MailClient(java.lang.Object delegate)

  - ### Method Detail

    - #### void close()

      close the MailClient

    - #### static MailClient createNonShared(Vertx vertx, java.util.Map<java.lang.String, java.lang.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, java.util.Map<java.lang.String, java.lang.Object> config, java.lang.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, java.util.Map<java.lang.String, java.lang.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)

    - #### java.lang.Object getDelegate()

    - #### MailClient sendMail(java.util.Map<java.lang.String, java.lang.Object> email = [:], io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.Map<java.lang.String, java.lang.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)