Class MailClient
- java.lang.Object
-
- io.vertx.mutiny.ext.mail.MailClient
-
public class MailClient extends Object
SMTP mail client for Vert.xA simple asynchronous API for sending mails from Vert.x applications
NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<MailClient>
__TYPE_ARG
static String
DEFAULT_POOL_NAME
The name of the default pool
-
Constructor Summary
Constructors Constructor Description MailClient(io.vertx.ext.mail.MailClient delegate)
MailClient(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Void>
close()
Close the MailClientVoid
closeAndAwait()
Blocking variant ofclose()
.void
closeAndForget()
Variant ofclose()
that ignores the result of the operation.static MailClient
create(Vertx vertx, io.vertx.ext.mail.MailConfig config)
static MailClient
createShared(Vertx vertx, io.vertx.ext.mail.MailConfig config)
static MailClient
createShared(Vertx vertx, io.vertx.ext.mail.MailConfig config, String poolName)
boolean
equals(Object o)
io.vertx.ext.mail.MailClient
getDelegate()
int
hashCode()
static MailClient
newInstance(io.vertx.ext.mail.MailClient arg)
io.smallrye.mutiny.Uni<io.vertx.ext.mail.MailResult>
sendMail(io.vertx.ext.mail.MailMessage email)
send a single mail via MailClientio.vertx.ext.mail.MailResult
sendMailAndAwait(io.vertx.ext.mail.MailMessage email)
Blocking variant ofsendMail(MailMessage)
.MailClient
sendMailAndForget(io.vertx.ext.mail.MailMessage email)
Variant ofsendMail(MailMessage)
that ignores the result of the operation.String
toString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final 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(io.vertx.ext.mail.MailClient delegate)
-
MailClient
public MailClient(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.mail.MailClient getDelegate()
-
create
public static MailClient create(Vertx vertx, io.vertx.ext.mail.MailConfig config)
- Parameters:
vertx
- the Vertx instance the operation will be run inconfig
- 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, io.vertx.ext.mail.MailConfig config, String poolName)
- Parameters:
vertx
- the Vert.x instanceconfig
- the configurationpoolName
- the pool name- Returns:
- the client
-
createShared
public static MailClient createShared(Vertx vertx, io.vertx.ext.mail.MailConfig config)
- Parameters:
vertx
- the Vert.x instanceconfig
- the configuration- Returns:
- the client
-
sendMail
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mail.MailResult> sendMail(io.vertx.ext.mail.MailMessage email)
send a single mail via MailClientUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
email
- MailMessage object containing the mail text, from/to, attachments etc- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
sendMailAndAwait
public io.vertx.ext.mail.MailResult sendMailAndAwait(io.vertx.ext.mail.MailMessage email)
Blocking variant ofsendMail(MailMessage)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
email
- MailMessage object containing the mail text, from/to, attachments etc- Returns:
- the MailResult instance produced by the operation.
-
sendMailAndForget
public MailClient sendMailAndForget(io.vertx.ext.mail.MailMessage email)
Variant ofsendMail(MailMessage)
that ignores the result of the operation.This method subscribes on the result of
sendMail(MailMessage)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsendMail(MailMessage)
but you don't need to compose it with other operations.- Parameters:
email
- MailMessage object containing the mail text, from/to, attachments etc- Returns:
- the instance of MailClient to chain method calls.
-
close
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
Close the MailClientUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
closeAndAwait
public Void closeAndAwait()
Blocking variant ofclose()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
closeAndForget
public void closeAndForget()
-
newInstance
public static MailClient newInstance(io.vertx.ext.mail.MailClient arg)
-
-