Get Email
Command description
Retrieve messages through IMAP. The command supports QQ Mail, 163 Mail, and 126 Mail, as well as custom IMAP settings for other providers.
The authorization code is not the mailbox login password. Obtain it after enabling IMAP/SMTP in the mailbox settings.
By default, the most recent emails are retrieved from the inbox INBOX. You can choose to retrieve only unread emails, mark them as read after retrieval, save attachments, or filter by sender, recipient, subject, and text contained in the body.
Command Input Parameters
| input parameters | Input parameter type | Description |
|---|---|---|
| Mailbox Type | enum | QQ Mail, 163 Mail, 126 Mail, Other Email Provider |
| IMAP Server | str | Required when the mailbox type is Other Email Provider, such as imap.example.com |
| IMAP Port | int or str | Required when the mailbox type is Other Email Provider, default 993 |
| Email Account | str | Mailbox account used to sign in |
| Authorization Code | str | Email authorization code |
| Email Count | int or str | Maximum number of emails retrieved, starting from the latest email |
| Unread Emails Only | bool | True to get only unread emails |
| Save Attachments | bool | Save email attachments when True |
| Attachment Save Directory | str | Required when saving attachments is True |
| Folder Selection Method | enum | Default, Dynamic |
| Folder Name | str | Required when Folder Selection Method is Dynamic; the inbox is usually INBOX |
| Mark as Read | bool | If True, mark each retrieved email as read |
| Sender Contains | str | Optional, no filtering if empty |
| Recipient Contains | str | Optional, no filtering if empty |
| Subject Contains | str | Optional, no filtering if empty |
| Body Contains | str | Optional, no filtering if empty |
Command Output Parameters
| Output parameters | Output parameter type | Description |
|---|---|---|
| Email List | list[dict] | Each email is a mapping, including subject, sender, receiver, cc, date, text, html, attachments, message_id |
Generation Notes
- Use the IMAP authorization code, not the web login password. Only Other Email Provider requires IMAP Server and IMAP Port.
- When Save Attachments is True, Attachment Save Directory is required.