Skip to main content

如何從 Excel 透過 Outlook 將郵件發送給列表中的多個收件人?

Author: Xiaoyang Last Modified: 2025-05-12

如果您的工作表某一欄中有許多電子郵件地址,現在您想直接從 Excel 發送郵件給這些收件人,而無需打開 Outlook。本文將介紹如何同時從 Excel 向多個收件人發送郵件。

使用 VBA 程式碼從 Excel 向多個收件人發送郵件

使用 VBA 程式碼將當前工作簿作為附件發送郵件給多個收件人


使用 VBA 程式碼從 Excel 向多個收件人發送郵件

您可以使用一段 VBA 程式碼一次向多個收件人發送郵件,請按照以下步驟操作:

1. 按住 ALT + F11 鍵以打開 Microsoft Visual Basic for Applications 視窗。

2. 點擊 插入 > 模組,然後在 模組視窗中粘貼以下程式碼。

VBA 程式碼:向多個收件人發送郵件

Sub sendmultiple()
'updateby Extendoffice
    Dim xOTApp As Object
    Dim xMItem As Object
    Dim xCell As Range
    Dim xRg As Range
    Dim xEmailAddr As String
    Dim xTxt As String
    On Error Resume Next
    xTxt = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select the addresses list:", "Kutools for Excel", xTxt, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    Set xOTApp = CreateObject("Outlook.Application")
    For Each xCell In xRg
        If xCell.Value Like "*@*" Then
            If xEmailAddr = "" Then
                xEmailAddr = xCell.Value
            Else
                xEmailAddr = xEmailAddr & ";" & xCell.Value
            End If
        End If
    Next
    Set xMItem = xOTApp.CreateItem(0)
    With xMItem
        .To = xEmailAddr
        .Display
    End With
End Sub

3. 接著按下 F5 鍵執行此程式碼,會彈出一個提示框提醒您選擇地址列表,參見截圖:

a screenshot of selecting the email addresses list after running the code

4. 然後點擊 確定,Outlook 郵件 視窗將顯示,您可以看到所有選定的電子郵件地址已添加到 收件人 欄位中,然後您可以輸入主題並撰寫郵件內容,參見截圖:

a screenshot of a created email with all selected email addresses listed in the To field

5. 完成郵件後,請點擊 發送 按鈕,這封郵件將被發送到您工作表列表中的這些收件人。


向多個收件人發送帶有不同附件的個人化郵件:

使用 Kutools for Excel發送郵件 功能,您可以快速從 Excel 通過 Outlook 根據需要向多個收件人發送帶有不同附件的個人化郵件。同時,您還可以將郵件抄送或密送給特定的人。 點擊下載 Kutools for Excel!

a screenshot of using the Send Emails feature of Kutools to easily send personalized emails to multiple recipients with different attachments


使用 VBA 程式碼將當前工作簿作為附件發送郵件給多個收件人

如果您需要將當前工作簿作為附件發送郵件給多個收件人,可以應用以下 VBA 程式碼。

1. 按住 ALT + F11 鍵以打開 Microsoft Visual Basic for Applications 視窗。

2. 點擊 插入 > 模組,然後在模組視窗中粘貼以下程式碼。

VBA 程式碼:將當前工作簿作為附件發送郵件給多個收件人

Sub EmailAttachmentRecipients()
'updateby Extendoffice
    Dim xOutlook As Object
    Dim xMailItem As Object
    Dim xRg As Range
    Dim xCell As Range
    Dim xEmailAddr As String
    Dim xTxt As String
    On Error Resume Next
    xTxt = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select the arresses list:", "Kutools for Excel", xTxt, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    Set xOutlook = CreateObject("Outlook.Application")
    Set xMailItem = xOutlook.CreateItem(0)
    For Each xCell In xRg
        If xCell.Value Like "*@*" Then
            If xEmailAddr = "" Then
                xEmailAddr = xCell.Value
            Else
                xEmailAddr = xEmailAddr & ";" & xCell.Value
            End If
        End If
    Next
    With xMailItem
        .To = xEmailAddr
        .CC = ""
        .Subject = ""
        .Body = ""
        .Attachments.Add ActiveWorkbook.FullName
        .Display
    End With
    Set xOutlook = Nothing
    Set xMailItem = Nothing
End Sub

3. 粘貼程式碼後,按 F5 鍵運行程式碼,會彈出一個提示框提醒您選擇要發送郵件的地址,參見截圖:

a screenshot of selecting the email addresses list after running the second VBA code

4. 然後點擊 確定 按鈕,Outlook 郵件 視窗將顯示,所有電子郵件地址都已添加到 收件人 欄位中,並且當前工作簿也已作為附件插入,然後您可以輸入主題並撰寫郵件內容,參見截圖:

a screenshot of a created email with all selected email addresses listed in the To field and the current workbook as attachment

5. 然後點擊 發送 按鈕,將此郵件連同當前工作簿作為附件發送給收件人列表。


相關文章:

如何從 Excel 通過 Outlook 向列表中的多個收件人發送個人化的群發郵件?


最佳辦公效率工具

🤖 Kutools AI 助手:基於智能執行方式革新數據分析:智能執行   |  生成代碼  |  創建自訂公式  |  分析數據並生成圖表  |  調用 Kutools 函數
熱門功能查找、標記重複值或識別重複項   |  刪除空行   |  合併列或單元格而不丟失數據   |   四捨五入無需公式 ...
高級 LOOKUP多條件 VLookup    多值 VLookup  |   多表查找   |   模糊查找 ....
高級下拉列表快速創建下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
列管理器添加特定數量的列  |  移動列  |  切換隱藏列的可見狀態  |  比較區域和列 ...
特色功能網格聚焦   |  設計檢視   |   增強編輯欄    工作簿與工作表管理器   |  資源庫(自動文本)   |  日期提取器   |  合併資料   |  加密/解密儲存格    按列表發送電子郵件   |  超級篩選   |   特殊篩選(篩選粗體/斜體/刪除線...) ...
頂級 15 種工具集12 個文本工具添加文本刪除特定字符、...)   |   50+ 圖表 類型甘特圖、...)   |   40+ 實用 公式基於生日計算年齡、...)   |   19 個插入工具插入QR碼根據路徑插入圖片、...)   |   12 個轉換工具金額轉大寫匯率轉換、...)   |   7 個合併與分割工具高級合併行分割儲存格、...)   |   ... 還有更多

使用 Kutools for Excel 提升您的 Excel 技巧,體驗前所未有的高效。 Kutools for Excel 提供超過 300 種高級功能來提高生產力並節省時間。  點擊這裡獲取您最需要的功能...


Office Tab 將標籤式界面帶到 Office,讓您的工作更加輕鬆

  • 在 Word、Excel、PowerPoint、Publisher、Access、Visio 和 Project 中啟用標籤式編輯和閱讀。
  • 在同一窗口的新標籤中打開和創建多個文檔,而不是在新窗口中。
  • 將您的生產力提高 50%,每天為您減少數百次鼠標點擊!