send_mail

send mail Sends an email.

Runs on: the server only. The statement that calls it runs on the server, and its result is a server-side value: the server keeps it, the device never writes it, and it is copied to the device only when a device statement reads it.

Format:

send_mail(to, subject, body, from [,html_format] [,attachments] )

Parameters:

Parameter Type Description
to string The email of the recipient (e.g. "mickey@mouse.com")
subject string The subject of the email (e.g. "A test email")
body string The body of the email. HTML tags may be used unless the html_format parameter is passed as FALSE
from string The name of the sender (e.g. "Minnie Mouse")
html_format boolean  [Optional]Specifies weather HTML format should be used for the email. default is TRUE
attachments cloudobject  [Optional]A stored file (what fileprompt or store_file returns) or a list of them, attached by name and type; 8 MB at most for all of them, else an error string and no mail. This is how a file reaches someone outside the app: a stored file's url opens only for the session it was handed to, so a url in the body is no link for the recipient.

Returned Value:

Type Description
string "OK" if the operation succeeded, or an error message otherwise.

Examples

 send_mail("nickey@mouse.com", "A test email", "This is the body of the test mail", "Minnie Mouse")