Pike v8.1 release 6

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


Method simple_mail

void simple_mail(string to, string subject, string from, string msg)

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". The "Date:" header is set to the current local time. The "Message-Id" header is set to a Standards.UUID followed by the hostname as returned by gethostname().

Note

If gethostname() is not supported, it will be replaced with the string "localhost".

Throws

If the mail server returns any other return code than 200-399 an exception will be thrown.