Send and receive mail APIs.
Since 1.5.2
method deleteMessage(emailServer as emailserveringoing, messageUID as int)
Deletes the message.
Since 1.5.2
function downloadAttachments(emailServer as emailserveringoing, messageUID as int) as collection of int
Downloads file attachments to storage from the specified message UID (messageUID) and returns the storage file IDs of the stored files.
Since 1.5.2
function receive(emailServer as emailserveringoing, startUID as int, lastUID as int) as list of emailin
Receives messages starting from the specified message UID (startUID) up to the specified last message UID (lastUID). The application should keep track of UIDs.
startUID argument is mandatory. Message UIDs start at 0 (zero).lastUID argument is optional and can be null. If lastUID is null, then all available messages are returned.Since 1.5.2
function send(emailServer as emailserveroutgoing, emailOut as emailout) as bool
Sends a message using the specified outgoing email server (emailServer) and email details (emailOut). Returns true if the message was sent successfully, or false otherwise.
Since 1.5.2
These functions are now ordered alphabetically for easier reference.
| Property | Type | Default value | Description |
|---|---|---|---|
| host | string | The host name (or IP) of the email server. | |
| port | string | 25 | The port of the email server. |
| user | string | The user to authenticate with the email server. | |
| password | string | The password to authenticate with the email server. | |
| protocol | string | One of smtp, smtps. | |
| debug | boolean | false | True if the interactions with this server should be logged into the debugLog property. |
| debugLog | collection of string | The debug log for this session. The collection will hold only the last 1024 messages. The log is not persistent and is only valid for this session. | |
| startTLS | boolean | false | |
| properties | string | Comma (,) separated properties with their values. |
| Property | Type | Default value | Description |
|---|---|---|---|
| host | string | The host name (or IP) of the email server. | |
| port | string | 993 | The port of the email server. |
| user | string | The user to authenticate with the email server. | |
| password | string | The password to authenticate with the email server. | |
| protocol | string | One of pop3, pop3s, imap, imaps. | |
| folderName | string | The folder for which messages are read. | |
| debug | boolean | false | True if the interactions with this server should be logged into the debugLog property. |
| debugLog | collection of string | The debug log for this session. The collection will hold only the last 1024 messages. The log is not persistent and is only valid for this session. | |
| properties | string | Comma (,) separated properties with their values. | |
| convertToUTF3B | boolean | true | Convert the received string tu UTF in 3 bytes format (for MySQL UTF8 compatibility). |
| maxMessages | int | 16 | Max messages to retrieve from the server |
| downloadAttachments | boolean | false | Download attachments in the receive function? |
| Property | Type | Description |
|---|---|---|
| uid | string | The unique id of the message. The id is unique only to this mail server folder and not globally. Message UIDs start at 0 (zero). |
| from | string | The sender email address. |
| fromName | string | The sender full name. |
| to | string | The receiver email address. |
| toName | string | The receiver full name. |
| subject | string | The subject. |
| content | string | The message content in the original format (html, text etc.) |
| date | datetime | The date the message was received. |
| hasAttachments | boolean | If the message has any attachments this field will be true. |
| attachments | collection of int | Storage ids of files that have been downloaded.if emailserverincoming.downloadAttachments is true. |
| Property | Type | Description |
|---|---|---|
| from | string | The sender email address. |
| fromName | string | The sender full name. |
| to | string | The receiver email address. |
| toName | string | The receiver full name. |
| subject | string | The subject. |
| content | string | The message content in the original format (html, text etc.) |
| date | datetime | The date the message was send/received?? |
| hasAttachments | boolean | If the message has any attachments this field will be true. |
| attachments | collection of int | The storage ids of files to attach to the email. |