Email Plug
Author: liux297
Contact: [email protected]
Repository: https://github.com/liux297/email_plug
Version: 0.1.7
Type: tool
Description
A complete Dify plugin for email operations via SMTP/IMAP protocols. It includes eight tools:
- Send Email: Send emails with HTML support, CC/BCC, attachments, and multiple recipients
- Search Email: Advanced search by sender (multiple senders supported), subject, body keyword, date range, read status, and reply status
- Get Attachment: Download attachments from emails or list all attachments, with Dify file service integration
- Check Reply: Check if a specific email has been replied to
- Mark Email: Mark emails as read or unread
- Delete Email: Delete emails (move to trash or permanent delete)
- Move Email: Move emails between folders
- List Folders: List all available mail folders
Setup
- Install the plugin in your Dify instance.
- Configure the following credentials:
SMTP Configuration (for sending):
IMAP Configuration (for receiving/searching):
Account:
Gmail: Generate an App Password
QQ Mail: Use authorization code instead of login password
Outlook: IMAP server is
Connection Requirements
The plugin connects directly from your Dify instance to your mail server over SMTP (sending) and IMAP (searching/management). You need the host address and port of your provider's SMTP and IMAP servers (see the table below), and the Dify instance must have outbound network access to those hosts. Credentials are stored encrypted in Dify and never logged.
Tools
Send Email
Send emails with advanced features:
- Multiple recipients (comma-separated)
- CC and BCC support
- HTML or plain text body
- Custom sender name
- File attachments (base64 encoded)
Search Email
Powerful email search with filters:
- Folder selection (INBOX, Sent, Archive, etc.)
- Sender filter (single sender or multiple senders separated by comma/semicolon, matching any of them)
- Subject keyword (supports Chinese/non-ASCII)
- Body keyword search
- Date range (start_date, end_date) or recent days
- Unread only filter
- Optional attachment retrieval
Get Attachment
Download attachments from emails:
- List all attachments (set attachment_index to -1)
- Download specific attachment by index
- Supports files up to configurable size limit (default 10MB)
- Returns base64 encoded content
Mark Email
Mark emails as read or unread using email IDs from search results.
Delete Email
Delete emails with two modes:
- Standard: Move to trash (recoverable)
- Permanent: Expunge immediately (unrecoverable)
Move Email
Move emails between folders (e.g., INBOX → Archive).
List Folders
Discover all available folder names in your mailbox.
Usage Examples
Send HTML email with CC:
Search unread emails from last 7 days:
Search by date range with body keyword:
Common IMAP/SMTP Servers