An CloudWriter program can send mail using the SendMail builtin global function.
string SendMail (string from, string to, string msg);
from is the from address in the form <name>@<domain>
to is the to address in the form <name>@<domain>
msg is the message
The return value is "" if the message was sent successfully. Otherwise, it is an error message.
Sending copies: <tbs>
The message can be simply the text of the message.
Optionally, the message may contain a header. If there is a header, the form of the message is <header>\r\n\r\n<message>.
The header may contain fields. The fields provide information that is parsed out by the receiving mail client and displayed in the mail header. The fields provide information like From:, To:, Subject:.
If fields are present they take the form: <fieldname>:<fieldvalue>
If more than one header field is present it is separated from the following header field by \r\n.
The message may be HTML-formatted if the receiving client knows about html. Simply code the text of the message between <html> .. </html>.
SendMail("me@mydomain", "you@yourdomain", "test");
SendMail("me@mydomain", "you@yourdomain", "This is\r\ntwo line message.");
msg = "From: Me\r\nTo: You\r\nSubject: Joke of the day\r\n\r\n"
"<html>this is the <e>text</e> of the message.</html>");
SendMail("me@mydomain", "you@yourdomain", msg);
When CloudWriter sends mail on your behalf it needs to know the following:
These are simply set as environment variables using the variable names EPPMailDomain and EPPMailHost.
Just set mail domain as your own domain.
Mail host is the host of your mail server.
Remember to set these environment variables as System variables, not as variables local to your own account, as CloudWriter is a system process.
<tbs>
John Elkins (john@vermontdatabase.com) 03 Sep 2002