Method Protocols.SMTP.AsyncClient()->create()
- Method
create
Protocols.SMTP.AsyncClient Protocols.SMTP.AsyncClient(void|string|objectserver,int|voidport,function(:void)|voidcb,mixed...args)- Description
Creates an SMTP mail client and connects it to the the
serverprovided. The server parameter may either be a string with the hostname of the mail server, or it may be a file object acting as a mail server. Ifserveris a string, then an optional port parameter may be provided. If no port parameter is provided, port 25 is assumed. If no parameters at all is provided the client will look up the mail host by searching for the DNS MX record.The callback will first be called when the connection is established (
cb(1, @args)) or fails to be established with an error. The callback will also be called with an error if one occurs during the delivery of mails.In the error cases, the
cbgets called the following ways:cb(({ 1, errno(), error_string, int(0..1) direct }), @args);cb(({ 0, smtp-errorcode, error_string, int(0..1) direct }), @args);
Where
directis1if establishment of the connection failed.