Mail Functions
This module contains functions for sending e-mail from XQuery. It is based on the Apache Commons Email library.
Conventions
The module must be installed in the repository before it can be used. The version that matches BaseX is retrieved from the BaseX Maven Repository:
REPO INSTALL mail
In order to use it, it needs to be imported in the header of the query:
import module namespace mail = 'http://basex.org/modules/mail';
All functions in this module are assigned to the http://basex.org/modules/mail namespace, which in the following is assumed to be bound to the mail prefix.
Errors raised by the underlying mail library are reported with a message that is prefixed with Mail: .
Functions
mail:send
| Signature | mail:send( $options as map(*)) as empty-sequence() | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Summary |
Sends an e-mail. The $options map carries both the SMTP connection settings and the message contents. The following keys are recognized:
The message body is encoded as UTF-8. Each address and | |||||||||||||||||||||||||||||||||||||||||||||
| Examples | Sends a plain-text e-mail via an authenticated SMTP server. |