Ich versuche, eine E-Mail an mehrere Empfänger zu senden, aber ich kann es nur an die letzte Person senden. Bitte helfen Sie mir, das Problem zu lösen. HierSenden von E-Mail an mehrere Empfänger VBA
ist das Programm, ich habe:
Sub Mail_Sending_WholWorkbook_Attachment()
'
' Mail_Sending_WholWorkbook_Attachment Macro
' This Macro is used to send the Bidresponse of the day as an attachment to the whole team with cc to santosh
'
' Keyboard Shortcut: Ctrl+Shift+B
'
'Working in Excel 2000-2016
'This example send the last saved version of the Activeworkbook
'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.to = "[email protected]"
.to = "[email protected]"
.to = "[email protected]"
.to = "[email protected]"
.CC = ""
.BCC = ""
.Subject = "BID RESPONSE"
.Body = "THIS IS AN AUTOMATIC MAIL SENT THROUGH MACROS." & vbNewLine & " " & vbNewLine & "Hi Team," & vbNewLine & " " & vbNewLine & "Attached is the bid response for the day." & vbNewLine & " " & vbNewLine & "Thanks & Regards," & vbNewLine & "Nagarjun B"
.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Sie müssen die Eigenschaft 'Recipients' verwenden, die eine Sammlung ist. '.Recipients.Add xxxxxx' für jeden Empfänger. –