Versenden von E-Mails an mehrere Empfänger mithilfe von vbscript

Mein vbscript sendet eine E-Mail automatisch an einen Empfänger, aber weiß jemand, wie man mehrere Empfänger hinzufügen, um es?

...
Dim ToAddress
Dim FromAddress
Dim MessageSubject
Dim MyTime
Dim MessageBody
Dim MessageAttachment
Dim ol, ns, newMail
MyTime = Now

ToAddress = "[email protected]"
MessageSubject = "It works!."
MessageBody = "Good job on that script." 
MessageAttachment = some attachment
Set ol = WScript.CreateObject("Outlook.Application")
Set ns = ol.getNamespace("MAPI")
Set newMail = ol.CreateItem(olMailItem)
newMail.Subject = MessageSubject
newMail.Body = MessageBody & vbCrLf & MyTime
newMail.RecipIents.Add(ToAddress)
newMail.Attachments.Add(MessageAttachment)
newMail.Send

Dies ist, was ich jetzt haben. Und es funktioniert gut. Aber ich hätte gerne mehr als einen Empfänger. Vielen Dank im Voraus.

newMail.CC = "[email protected];[email protected];[email protected]"

Diese Zeile oben gearbeitet!

Und es funktioniert auf die gleiche Weise mit .BCC, falls jemand will nicht, um die Anzeige der Kontakte " - Liste.

  • Verwenden Sie BCC anstatt CC.
  • Vielen DANK für die Hilfe.
InformationsquelleAutor duper | 2012-07-03
Schreibe einen Kommentar