GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Twelve — Internet Functions (continued)
Overview
The EmailSendMessage function sends an email message. The body can be text or HTML or a series of attachments.
Syntax/Parameters
Syntax
int = EmailSendMessage ( string to, string subject, string body | string
data[],
[dword
flags] );
Parameters
to
A string containing one or more email addresses.
subject
A string containing the subject. This string should be simple text. Note that the content (or lack there of) can affect junk mail ranking.
body
A string specifying the content of the message. Or,
data
A string list containing the message and a series of attachments.
flags
An optional dword containing directives, see Remarks below.
Return Value
Returns an int as ERROR_NONE (0) or a formatted error code on failure. Use the GetLastError and GetLastErrorMessage functions to retrieve additional details.
If the function returns without an error, it does not mean the message has been sent, only that it has been posted for sending.
Remarks
The application settings for email must be previously setup either in the preferences or using the EmailSetupSMTP function.
Multiple email additions should be separated by a comma or semicolon. The email address must only be an email address, not a formatted name and email address.
The message body can be specified as simple string or as an array of items. All text information is assumed to be the UTF-8 character set.
A simple string is added as text or HTML. It can contain simple returns (0x0D) for line endings or combination return/new line (0x0D 0x0A). The function will detect HTML and set the appropriate MIME type.
If a data array is used for the message, each entry is one of a multi-part MIME encoded message. Generally, the first entry should be the message body with subsequent attachments. All elements are base-64 encoded.
Each entry can be formatted as follows:
Simple String — Text or HTML, this is normally used for the message body. The encoding is set for UTF-8 and the MIME type is plain text or HTML.
Filename — If the string is detected as a fully qualified filename, the function will assume it is a file attachment. The file must exist and be able to be opened in read mode. The MIME type is determined by the file extension. For example, “.png” file type will set the type to “image/png”.
Handle — If a hex handle is provided, it is assumed to be a Legato object. The format is as follows:
0xNNNNNNNN mimetype filename
The hex value is simply a string version of the handle value for the specified object. It must lead with ‘0x’. The mimetype must be a matching valid mime string and the filename is just the name and extension. For example:
handle hDO;
string list[];
hDO = DataObjectLoadFile(R"D:\Data\Email\tiny.png");
list[0] = "<p>Email Body: Here is some <b>bold</b> text.</p><p>Line 2!</p>";
list[1] = R"D:\Data\Email\test.docx";
list[2] = FormatString("0x%08X image/png tiny.png", hDO);
rc = EmailSendMessage(to, "A Little Email", list, true);
The handle can point to a Data or Pool Object.
The optional flags parameter allows certain options to be set. To not have the email queue for background, set the value to TRUE. Additional flag bits may be added in later versions.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.