VBScript của tôi gửi email tự động đến người nhận, nhưng có ai biết cách thêm nhiều người nhận vào đó không?Gửi email tới nhiều người nhận bằng cách sử dụng vbscript
...
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
Đây là những gì tôi có ngay bây giờ. Và nó hoạt động tốt. Nhưng, tôi muốn có nhiều người nhận. Cảm ơn trước.
newMail.CC = "[email protected];[email protected];[email protected]"
Dòng trên đây đã hiệu quả!
Và nó hoạt động theo cùng một cách với .BCC, trong trường hợp bất kỳ ai muốn không hiển thị danh sách liên hệ.
Sử dụng BCC thay vì CC. – JimmyPena
@JP. Cảm ơn đã giúp đỡ. – duper