|
|||||
|
||||||
Other Library Functions |
function |
MailOutBoxSendMail |
Library: Net, Email support, SMTP and POP3 (OMMAIL)
Include: ommail.xin |
Return type: output Returns: An external output object. |
define external output function MailOutBoxSendMail value MailOutBox this-MailOutBox to value stream recipient subject value stream subject optional initial {""} header value stream header-info optional
This function sends a mail message with the specified subject, mail header, and recipient or recipients. It returns an external output object which is used to send the body of the message. As you write to the stream, the message parts are sent out (there is no buffering of the message). Closing the stream attached to this external output object signals the end of message composition and triggers the completion of the delivery of the message. It is an error to reopen a stream attached to an external output object derived from a mail outbox object, once that stream has been closed.
Arguments:
Example:
include "ommail.xin" process local stream msg local stream t-Error variable initial-size 0 local MailOutBox this-MailOutBox set this-MailOutBox to MailOutBoxCreate name "joe" address "[email protected]" open msg as MailOutBoxSendMail this-MailOutBox to "[email protected]" subject "Greetings" MailOutBoxGetStatusReport this-MailOutBox into t-Error repeat over t-Error put #error t-Error again halt when number of t-Error > 0 put msg "Just wanted " || "to say " || "hello." || "%n" close msg ; Note: the close action sent the msg