如何在 Outlook 中批量发送多封草稿邮件?
如果您的草稿文件夹中有多封邮件草稿,想要一次性全部发送,而不是逐一手动发送,如何在 Outlook 中高效快捷地完成这一操作?
使用 VBA 代码在 Outlook 中一次性发送所有草稿邮件
使用 VBA 代码在 Outlook 中一次性发送所有草稿邮件
下面的 VBA 代码可以帮助您一次性发送草稿文件夹中的所有或部分草稿邮件,请按如下操作:
1. 按住 ALT + F11 键即可打开 Microsoft Visual Basic for Applications 窗口。
2. 接着点击插入 > 模块,将以下代码复制并粘贴到打开的空白模块中(见截图):
VBA 代码:一键发送所有草稿邮件(Outlook):
Sub SendAllDraftEmails()
Dim xAccount As Account
Dim xDraftFld As Folder
Dim xItemCount As Integer
Dim xCount As Integer
Dim xDraftsItems As Outlook.Items
Dim xPromptStr As String
Dim xYesOrNo As Integer
Dim i As Long
Dim xCurFld As Folder
Dim xTmpFld As Folder
On Error Resume Next
xItemCount = 0
xCount = 0
Set xTmpFld = Nothing
Set xCurFld = Application.ActiveExplorer.CurrentFolder
For Each xAccount In Outlook.Application.Session.Accounts
Set xDraftFld = xAccount.DeliveryStore.GetDefaultFolder(olFolderDrafts)
xItemCount = xItemCount + xDraftFld.Items.Count
If xDraftFld.EntryID = xCurFld.EntryID Then
Set xTmpFld = xCurFld.Parent
End If
Next xAccount
Set xDraftFld = Nothing
If xItemCount > 0 Then
xPromptStr = "Are you sure to send out all the drafts?"
xYesOrNo = MsgBox(xPromptStr, vbQuestion + vbYesNo, "Kutools for Outlook")
If xYesOrNo = vbYes Then
If Not xTmpFld Is Nothing Then
Set Application.ActiveExplorer.CurrentFolder = xTmpFld
End If
VBA.DoEvents
For Each xAccount In Outlook.Application.Session.Accounts
Set xDraftFld = xAccount.DeliveryStore.GetDefaultFolder(olFolderDrafts)
Set xDraftsItems = xDraftFld.Items
For i = xDraftsItems.Count To 1 Step -1
If xDraftsItems.Item(i).Recipients.Count <> 0 Then
xDraftsItems.Item(i).sEnd
xCount = xCount + 1
End If
Next
Next xAccount
VBA.DoEvents
Set Application.ActiveExplorer.CurrentFolder = xCurFld
MsgBox "Successfully sent " & xCount & " messages", vbInformation, "Kutools for Outlook"
End If
Else
MsgBox "No Drafts!", vbInformation + vbOKOnly, "Kutools for Outlook"
End If
End Sub

3. 保存代码后,按下 F5 键运行,系统将弹出提示框询问是否发送全部草稿邮件,点击是,见截图:

4. 随后将弹出对话框,提示已发送的草稿邮件数量,详见截图:

5. 然后点击确定按钮,即可一次性发送草稿文件夹中的所有邮件,见截图:

注意:
1. 上述代码将会发送您 Outlook 中所有帐户下的所有草稿邮件。
2. 如果您只需发送草稿文件夹中的部分指定邮件,请使用以下 VBA 代码:
VBA 代码:发送草稿文件夹中选定邮件:
Sub SendSelectedDraftEmails()
Dim xSelection As Selection
Dim xPromptStr As String
Dim xYesOrNo As Integer
Dim i As Long
Dim xAccount As Account
Dim xCurFld As Folder
Dim xDraftsFld As Folder
Dim xTmpFld As Folder
Dim xArr() As String
Dim xCount As Integer
Dim xMail As MailItem
On Error Resume Next
xCount = 0
Set xTmpFld = Nothing
Set xCurFld = Application.ActiveExplorer.CurrentFolder
For Each xAccount In Outlook.Application.Session.Accounts
Set xDraftsFld = xAccount.DeliveryStore.GetDefaultFolder(olFolderDrafts)
If xDraftsFld.EntryID = xCurFld.EntryID Then
Set xTmpFld = xCurFld.Parent
End If
Next xAccount
If xTmpFld Is Nothing Then
MsgBox "The current folder is not a draft folder", vbInformation, "Kutools for Outlook"
Exit Sub
End If
Set xSelection = Outlook.Application.ActiveExplorer.Selection
If xSelection.Count > 0 Then
xPromptStr = "Are you sure to send out the selected " & xSelection.Count & " draft item(s)?"
xYesOrNo = MsgBox(xPromptStr, vbQuestion + vbYesNo, "Kutools for Outlook")
If xYesOrNo = vbYes Then
ReDim xArr(xSelection.Count - 1)
For i = 1 To xSelection.Count
xArr(i - 1) = xSelection.Item(i).EntryID
Next
Set Application.ActiveExplorer.CurrentFolder = xTmpFld
VBA.DoEvents
For i = 0 To UBound(xArr)
Set xMail = Application.Session.GetItemFromID(xArr(i))
If xMail.Recipients.Count <> 0 Then
xMail.sEnd
xCount = xCount + 1
End If
Next
VBA.DoEvents
Set Application.ActiveExplorer.CurrentFolder = xCurFld
MsgBox "Successfully sent " & xCount & " messages", vbInformation, "Kutools for Outlook"
End If
Else
MsgBox "No items selected!", vbInformation, "Kutools for Outlook"
End If
End Sub
Outlook AI 邮件助手:智能回复,沟通更高效清晰(只需一键,轻松体验神奇效果!)
通过 Kutools for Outlook 的 AI 邮件助手,轻松提升您的日常 Outlook 工作效率。该强大工具能够智能学习您的邮件习惯,提供高效、精准的回复建议,优化邮件内容,助您轻松起草和润色邮件。

该功能支持:
- 智能回复:根据您的历史对话内容生成个性化且精准的回复,随时为您所用。
- 内容优化:自动完善您的邮件文本,让表达更加清晰且更具影响力。
- 轻松写作:您只需输入关键词,剩下的交给 AI,多种润色风格随心选择。
- 智能扩展:结合上下文,智能拓展您的想法,提供精准建议。
- 智能摘要:轻松为冗长邮件快速生成简明概览,让信息一目了然。
- 全球畅邮:轻松将邮件翻译为任意语言。
该功能支持:
- 智能邮件回复
- 内容优化
- 关键词草稿
- 智能内容扩展
- 邮件摘要
- 多语言翻译
相关文章:
如何通过 Outlook 利用 Excel 表格实现个性化群发邮件?
如何在 Outlook 中群发邮件时避免收件人互相看到彼此的信息?
最佳办公效率工具
体验全新 Kutools for Outlook,畅享 100+ 强大功能!立即点击下载,不容错过!
🤖KUTOOLS AI:采用先进 AI 技术,轻松处理邮件,涵盖回复、摘要、优化、扩展、翻译及撰写等功能。
📧 邮件自动化:自动答复(支持 POP 和 IMAP)/定时发送邮件/发送邮件时按规则自动抄送密送/自动转发(高级规则)/自动添加称呼/自动将多收件人邮件拆分为单独信息……
📨 邮件管理:撤回邮件/按主题等条件拦截诈骗邮件/删除重复邮件/高级搜索/整合文件夹……
📁 附件增强:批量保存/批量分离/批量压缩/自动保存/自动拆离/自动压缩……
🌟 界面魔法:😊更多美观时尚表情/重要邮件到达时提醒您/最小化 Outlook 而不是直接关闭……
👍 一键精彩功能:带附件全部答复/反钓鱼邮件/🕘显示发送者当前时间时区……
👩🏼🤝👩🏻 联系人与日历:批量从选定邮件中提取添加联系人/将联系人组拆分为个人组/移除生日提醒……
在您的首选语言中畅享 Kutools —— 支持英语、西班牙语、德语、法语、中文等 40 多种语言!
一键解锁 Kutools for Outlook,告别等待,立即下载,让效率倍增!


🚀 一键下载 — 即可获取全部 Office 加载项
强烈推荐:Kutools for Office(5 合 1)
一键下载五个安装包,即可同时获得 Kutools for Excel、Outlook、Word、PowerPoint 和 Office Tab Pro。立即点击下载!
- ✅ 一键便捷:只需一次操作,即可下载全部五个安装包。
- 🚀 轻松应对各类 Office 任务:随时按需安装所需插件,助您高效办公,不容错过!
- 🧰 包含:Kutools for Excel / Kutools for Outlook / Kutools for Word / Office Tab Pro / Kutools for PowerPoint