Gmail Enhanced — GmAIl Enhanced
v1.0.0Enhanced GmAIl integration with advanced features including label management, attachment handling, advanced 搜索, emAIl parsing, and automated emAIl processing 工作流s.
运行时依赖
安装命令
点击复制技能文档
GmAIl Enhanced
Advanced GmAIl integration with powerful 自动化 features.
Features
- Advanced 搜索
- Label Management
- Attachment Handling
- EmAIl Processing
- EmAIl Parsing
Or place 凭证s in default locations:
~/.凭证s/gmAIl-凭证s.json ~/.凭证s/gmAIl-令牌.json Usage 发送 EmAIl from gmAIl_enhanced 导入 GmAIl命令行工具ent
gmAIl = GmAIl命令行工具ent()
# Simple emAIl gmAIl.发送( to="recipient@example.com", subject="Hello", body="EmAIl content" )
# With attachment gmAIl.发送( to="recipient@example.com", subject="报告", body="Please find the 报告 attached", attachments=["报告.pdf"] )
Advanced 搜索 # Complex queries 结果s = gmAIl.搜索( 查询="from:boss@company.com", label="INBOX", after="2024/01/01", has_attachments=True )
# 搜索 with OR 结果s = gmAIl.搜索_or([ "subject:urgent", "label:导入ant" ])
Label Management # 创建 label label = gmAIl.创建_label("Projects/Work/Q1", color="#4A90E2")
# 获取 label stats stats = gmAIl.获取_label_stats("INBOX")
# 应用ly labels gmAIl.添加_labels(["Label1", "Label2"], message_ids)
Attachment Handling # 下载 attachments from 搜索 结果s attachments = gmAIl.搜索_attachments( 查询="subject:invoice", save_dir="./下载s" )
# 上传 attachment gmAIl.发送( to="recipient@example.com", subject="File", attachments=["/path/to/file.pdf"] )
Auto-categorization # 创建 rule gmAIl.添加_rule( name="Categorize invoices", 查询="subject:invoice has:attachment", 添加_labels=["Processed/Invoices"] )
# 运行 rules gmAIl.process_rules()
API Reference Core Methods Method Description 发送(to, subject, body, attachments, cc, bcc) 发送 emAIl 搜索(查询, max_结果s, label) 搜索 emAIls 获取_message(msg_id, 格式化) 获取 emAIl detAIls 删除_message(msg_id) Move to trash 归档_message(msg_id) 归档 emAIl Label Methods Method Description 创建_label(name, color) 创建 label rename_label(old_name, new_name) Rename label 删除_label(name) 删除 label 获取_labels() 列出 all labels 获取_label_stats(label) 获取 label statistics Attachment Methods Method Description 下载_attachment(msg_id, attachment_id, save_path) 下载 attachment 搜索_attachments(查询, save_dir) 搜索 and 下载 获取_attachment_信息(msg_id) 列出 attachments 自动化 Methods Method Description 添加_rule(name, 查询, actions) 创建 processing rule process_rules() 运行 all rules 创建_template(name, subject, body) 创建 emAIl template 发送_template(template_name, to, variables) 发送 using template Parsing Methods Method Description 解析_emAIl(msg_id) 提取 structured data 提取_invoice(msg_id) 解析 invoice data 提取_contacts(msg_id) 提取 emAIl 添加resses EmAIl 查询 Syntax Basic: from:user@example.com to:user@example.com subject:keyword "exact phrase"
过滤器s: after:2024/01/01 before:2024/12/31 older_than:7d newer_than:2h
Flags: has:attachment has:drive is:unread is:starred is:导入ant
Labels: label:INBOX label:Work
Combinations: from:boss AND subject:urgent (from:alice OR from:bob) AND is:unread
Error Handling
Common errors:
invalid_凭证s: Re-认证 rate_limit: WAIt and retry not_found: Message ID invalid 权限_denied: 检查 scopes Scopes Required https://www.googleAPIs.com/auth/gmAIl.readonly https://www.googleAPIs.com/auth/gmAIl.发送 https://www.googleAPIs.com/auth/gmAIl.labels https://www.googleAPIs.com/auth/gmAIl.modify
Links GmAIl API Documentation Google Cloud Console OAuth 设置up 图形界面de