how to create group email with CDO Using VB6

怎甘沉沦 提交于 2020-01-07 02:02:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!