<commit_before># Vert.x mail (SMTP client)

A first version of a smtp client for vert.x.

The test classes shows how this could be used, the whole client is async and
supports SSL, STARTTLS, a few methods of SASL.

Supported are plaintext and html messages with UTF-8, binary attachments and
multipart/alternative.

Using codegen, the client interface is available in different languages
supported by vert.x

* link:vertx-mail-client/src/main/asciidoc/java/index.adoc[Java in-source docs]
* link:vertx-mail-client/src/main/asciidoc/js/index.adoc[JavaScript in-source docs]
* link:vertx-mail-client/src/main/asciidoc/groovy/index.adoc[Groovy in-source docs]
* link:vertx-mail-client/src/main/asciidoc/ruby/index.adoc[Ruby in-source docs]

For questions about the project, please write a message on the vert.x google
group or drop by on irc.

`link:../../apidocs/io/vertx/ext/mail/MailClient.html[MailClient]` simple example:

[source,java]
----
MailConfig mailConfig = new MailConfig()
  .setHostname("mail.example.com")
  .setPort(587)
  .setUsername("user")
  .setPassword("pw");

MailClient mailClient = MailClient.create(vertx, mailConfig);

MailMessage email = new MailMessage()
  .setFrom("<EMAIL>")
  .setTo("<EMAIL>")
  .setSubject("meaningful subject")
  .setText("this is a message")
  .setHtml("HTML message <a href=\"http://vertx.io\">vertx</a>");

mailClient.sendMail(email, result -> {
  if (result.succeeded()) {
    System.out.println(result.result());
  } else {
    System.out.println("got exception");
    result.cause().printStackTrace();
  }
});
----
attachments can be added as Buffer object

[source,java]
----
MailConfig mailConfig = new MailConfig();

MailClient mailClient = MailClient.create(vertx, mailConfig);

MailMessage email = new MailMessage()
  .setFrom("<EMAIL>")
  .setTo("<EMAIL>")
  .setSubject("your file")
  .setText("please take a look at the attached file");

MailAttachment attachment = new MailAttachment()
  .setName("file.dat")
  .setData(Buffer.buffer("ASDF1234\0\u0001\u0080\u00ff\n"));

email.setAttachment(attachment);

mailClient.sendMail(email, result -> {
  if (result.succeeded()) {
    System.out.println(result.result());
  } else {
    System.out.println("got exception");
    result.cause().printStackTrace();
  }
});
----
the service interface can send mails via the eventbus if the service is running
on other machine in the cluster

*TODO*
----<commit_msg>removed redundant stuff from README<commit_after># Vert.x mail (SMTP client)

A Simple asynchronous SMTP client for Vert.x

Please see the documentation for more information.

* link:vertx-mail-client/src/main/asciidoc/java/index.adoc[Java in-source docs]
* link:vertx-mail-client/src/main/asciidoc/js/index.adoc[JavaScript in-source docs]
* link:vertx-mail-client/src/main/asciidoc/groovy/index.adoc[Groovy in-source docs]
* link:vertx-mail-client/src/main/asciidoc/ruby/index.adoc[Ruby in-source docs]
{'fraction_non_alphanumeric': 0.138013698630137, 'fraction_numerical': 0.006506849315068493, 'mean_word_length': 4.53219696969697, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2672379', 'n_tokens_mistral': 992, 'n_tokens_neox': 950, 'n_words': 238}