问题
How can I send an email to a group of recipients with CDO? I'm using VB6.
回答1:
You can list multiple recipients on the .To line by separating them with ";", for example:
Set m = Server.CreateObject("CDO.Message")
m.Subject="subject..."
m.From="sender@example.com"
m.To="some@email.com;other@email.com;third@email.com"
m.TextBody="Message"
m.Send
回答2:
This works in Office 97 and whatever Exchange we had back then:
Dim oOApp As Outlook.Application
Dim newMail As Outlook.MailItem
Set oOApp = CreateObject("Outlook.Application")
Set newMail = oOApp.CreateItem(olMailItem)
With newMail
.Display
.Body = whatever
.Subject = whatever
.Attachments.Add whatever
.Recipients.Add (whomever)
.Send
End With
Set newMail = Nothing
Set oOApp = Nothing
来源:https://stackoverflow.com/questions/4412129/how-to-create-group-email-with-cdo-using-vb6