The common process for receiving emails has the following steps:
You can retrieve messages using one of
Both return an Array of ReceivedMail (see Processing Messages further below).
You can process emails as you need. Retrieved messages are delivered as an Array of ReceivedMail objects, which inherit from Mail and add some more attributes available after receiving:
After messages have been retrieved, they are often deleted or moved to a specific folder.
Deleting messages is done by any one of the following operations:
deleteMessage and deleteMessages operate on an instance of ReceivedMail, means you can call them on objects returned by a read on the mailbox. deleteMessagesFiltered operates on a folder and a filter criterion. It deletes all matching messages.
Deletion is always "hard" deletion. Mail items are not moved to "Trash" or "Deleted Items". Once deleted, the message is gone. |
Moving messages operates in instances of ReceivedMail, objects returned by a read on the mailbox. You can specify the target folder to move the message to.