Kaya 0.4.4 reference for Mail::sendmail

List of functions and data types in Mail

Void sendmail(String from, String whoto, [Pair<String, String> ] headers, String body, String server="localhost", Int port=25)

Arguments

Usage

Sends an email via SMTP as specified in the email.

body = "..."; // text of message goes here
headers = [("X-Mailer","Kaya"),
           ("Subject","Example Message"),
           ("Cc","example2@kayalang.org")];
sendmail("kaya@kayalang.org","example1@kayalang.org",headers,body);

The To, From and Date headers are set automatically and do not need adding to the headers array. Only the body parameter may contain newlines.

An Exception will be thrown if the header values are invalid, the SMTP server is unavailable, or the SMTP server rejects the message.

kaya@kayalang.org | Last modified 29 November 2011 | Supported by Durham CompSoc | Powered by Kaya