email() = {string() | binary(), [string() | binary(), ...], string() | binary() | function()}
abstract datatype: smtp_client_socket()
| close/1 | Close an open smtp client socket opened with open/1. |
| deliver/2 | Deliver an email on an open smtp client socket. |
| open/1 | Open a SMTP client socket with the provided options Once the socket has been opened, you can use it with deliver/2. |
| send/2 | Send an email in a non-blocking fashion via a spawned_linked process. |
| send/3 | Send an email nonblocking and invoke a callback with the result of the send. |
| send_blocking/2 | Send an email and block waiting for the reply. |
close(Socker::smtp_client_socket()) -> ok
Close an open smtp client socket opened with open/1.
deliver(Socket::smtp_client_socket(), Email::email()) -> {ok, Receipt::binary()} | {error, any()}
Deliver an email on an open smtp client socket.
For use with a socket opened with open/1. The socket can be reused as long as the previous call to deliver/2 returned {ok, Receipt}.
open(Options::list()) -> {ok, SocketDescriptor::smtp_client_socket()} | {error, any()}
Open a SMTP client socket with the provided options Once the socket has been opened, you can use it with deliver/2.
send(Email::email(), Options::list()) -> {ok, pid()} | {error, any()}
Send an email in a non-blocking fashion via a spawned_linked process. The process will exit abnormally on a send failure.
send(Email::email(), Options::list(), Callback::function() | undefined) -> {ok, pid()} | {error, any()}
Send an email nonblocking and invoke a callback with the result of the send.
The callback will receive either {ok, Receipt} where Receipt is the SMTP server's receipt
identifier, {error, Type, Message} or {exit, ExitReason}, as the single argument.
send_blocking(Email::email(), Options::list()) -> binary() | {error, atom(), any()} | {error, any()}
Send an email and block waiting for the reply. Returns either a binary that contains
the SMTP server's receipt or {error, Type, Message} or {error, Reason}.
Generated by EDoc