Pike v8.0 release 1738

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


Method simple_mail

void simple_mail(string to, string subject, string from, string msg, function(:void)|void cb, mixed ... args)

Description

Sends an e-mail. Wrapper function that uses send_message.

Note

Some important headers are set to: "Content-Type: text/plain; charset=iso-8859-1" and "Content-Transfer-Encoding: 8bit". "Date:" header isn't used at all.

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.