Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: Send to multiple recipients with CDONTS

Results 1 to 3 of 3
Share This Thread →
  1. #1
    dcampos's Avatar
    dcampos is offline Contributing User
    Join Date
    Aug 2004
    Posts
    258
    Rep Power
    10

    Send to multiple recipients with CDONTS

    I am using CDONTS to send a confirmation email. I am using plain text to send my email. I would like to send to multiple users, but I am already using the "To," "Cc," and "Bcc." Is it possible to send to multiple recipients in the "To" field? I am also using variables instead of hard coded email addresses. Here is my code:

    Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    MyCDONTSMail.From= TeacherEmail
    MyCDONTSMail.To= Administrator, Administrator2, Administrator3
    MyCDONTSMail.Cc= Secretary
    MyCDONTSMail.Bcc= TeacherEmail

    I keep getting the following error though:

    Expected end of statement

    Any ideas?

  2. #2
    blicci's Avatar
    blicci is offline Contributing User
    Join Date
    Apr 2004
    Location
    Philly
    Posts
    466
    Rep Power
    133
    you can store the names in a array
    dim strRecipients(5) as string

    dim strTo as string
    dim i as integer
    For i = 0 to 4
    strTo = strTo & strRecipients(i) & ";"
    next i
    MyCDONTSMail.To = strTo

  3. #3
    Bongle is offline Registered User
    Join Date
    Oct 2004
    Posts
    10
    Rep Power
    0
    Quote Originally Posted by dcampos
    I am using CDONTS to send a confirmation email. I am using plain text to send my email. I would like to send to multiple users, but I am already using the "To," "Cc," and "Bcc." Is it possible to send to multiple recipients in the "To" field? I am also using variables instead of hard coded email addresses. Here is my code:

    Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    MyCDONTSMail.From= TeacherEmail
    MyCDONTSMail.To= Administrator, Administrator2, Administrator3
    MyCDONTSMail.Cc= Secretary
    MyCDONTSMail.Bcc= TeacherEmail

    I keep getting the following error though:

    Expected end of statement

    Any ideas?
    Seperate by commas, as if you were sending a normal email.

    Example:
    Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    MyCDONTSMail.From= TeacherEmail
    MyCDONTSMail.To= Administrator & ", " & Administrator2 & ", " & Administrator3
    MyCDONTSMail.Cc= Secretary
    MyCDONTSMail.Bcc= TeacherEmail

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

  1. How Can I Send The Mail To Multiple Recipients
    By padmanaban in forum ASP Development
    Replies: 1
    Last Post: September 11th, 2004, 01:18 PM
  2. Send e-mails to multiple recipients using database
    By tonya in forum ASP Development
    Replies: 36
    Last Post: May 27th, 2004, 09:48 AM
  3. How to send multiple mails using ASP and CDONTS?
    By longhorn14 in forum ASP Development
    Replies: 7
    Last Post: December 21st, 2002, 01:59 AM
  4. multiple recipients using CDONTS
    By Steve Schofield in forum ASP Development
    Replies: 1
    Last Post: June 5th, 2002, 12:08 PM
  5. Replies: 1
    Last Post: February 9th, 2002, 01:55 AM

ASP Free Advertisers and Affiliates