如何使用VB6使用CDO创建组电子邮件

时间:2010-12-10 16:59:50

标签: vb6

如何通过CDO向一组收件人发送电子邮件?我正在使用VB6。

2 个答案:

答案 0 :(得分:4)

您可以在.To行上列出多个收件人,方法是用“;”分隔,例如:

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

答案 1 :(得分:-1)

这适用于Office 97以及我们当时拥有的任何Exchange:

    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