public interface MailService
Modifier and Type | Method and Description |
---|---|
static MailService |
create(Vertx vertx,
MailConfig config)
create an instance of MailService that is running in the local JVM
|
static MailService |
createEventBusProxy(Vertx vertx,
String address)
create an instance of MailService that calls the mail service via the event bus running somewhere else
|
MailService |
sendMail(MailMessage email,
Handler<AsyncResult<JsonObject>> resultHandler)
send a single mail via MailService
|
void |
start()
start the MailServer instance if it is running locally (this operation is currently a no-op)
|
void |
stop()
stop the MailServer instance if it is running locally
|
static MailService create(Vertx vertx, MailConfig config)
vertx
- the Vertx instance the operation will be run inconfig
- MailConfig configuration to be used for sending mailsstatic MailService createEventBusProxy(Vertx vertx, String address)
vertx
- the Vertx instance the operation will be run inaddress
- the eb address of the mail service running somewhere, default is "vertx.mail"MailService sendMail(MailMessage email, Handler<AsyncResult<JsonObject>> resultHandler)
email
- MailMessage object containing the mail text, from/to, attachments etcresultHandler
- will be called when the operation is finished or it fails
(may be null to ignore the result)
the result JsonObject currently only contains {"result":"success"}
void start()
void stop()
this operation shuts down the connection pool, doesn't wait for completion of the close operations when the mail service is running on the event bus, this operation has no effect
Copyright © 2015. All Rights Reserved.