Pike v8.0 release 1738

Method Protocols.SMTP.AsyncClient()->send_message()


Method send_message

void send_message(string from, array(string) to, string body, function(:void)|void cb, mixed ... args)

Description

Sends a mail message from from to the mail addresses listed in to with the mail body body. The body should be a correctly formatted mail DATA block, e.g. produced by MIME.Message.

When the message is successfully sent, the callback will be called (cb(1, @args);).

When the message cannot be sent, cb will be called in one of 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 direct will be 1 if this particular message caused the error and 0 otherwise.

See also

simple_mail