#1
  1. Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Aug 2004
    Posts
    258
    Rep Power
    11

    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
  3. Contributing User
    ASP Discoverer (100 - 499 posts)

    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
  4. #3
  5. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2004
    Posts
    10
    Rep Power
    0
    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

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

IMN logo majestic logo threadwatch logo seochat tools logo