Mail.sendmail3kaya
Send a mail via smtp
Usage
Void sendmail( String from, String whoto, [Pair<String, String> ] headers, String body, String server="localhost", Int port=25 )
Arguments
from The email address to send the message from
whoto The email address to send the message to
headers A list of name-value pairs for additional mail headers to send: consult RFC 2822 for further details.
body The body of the message.
server The hostname or IP address of the SMTP server (this is optional, and localhost will be used if it is not specified).
port The TCP port on the server to connect to (this is optional and the standard SMTP port of 25 will be used if it is not specified).
Overview
Sends an email via SMTP as specified in the email.
-
body = "..."; // text of message goes here
headers = [("X-Mailer","Kaya"),
("Subject","Example Message"),
("Cc","[email protected]")];
sendmail("[email protected]","[email protected]",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.
Releases
4 releases since Debian 5.0 (Lenny); the text changed 3 times.