SMTP-Two Emails ?

Results 1 to 3 of 3

Thread: SMTP-Two Emails ?

  1. #1
    Join Date
    Dec 1969

    Default SMTP-Two Emails ?

    Hi guys, I use the simple:<BR>Set oMail=Server.CreateObject("CDONTS.Newmail")<BR>// fill in details<BR>to send an email but how can I send two separate emails from the same page ?<BR>I even tried creating a new mail object to no avail. I don&#039;t understand why it doesn&#039;t work. I&#039;m using ASP on a Win2K server. Please help, thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: SMTP-Two Emails ?

    Perhaps check out the following:<BR><BR>ASP News Letter by Faisal Khan<BR><BR>Loops thru recordset and sends an e-mail to each:<BR>While Not rs.EOF<BR> Set mail = Server.CreateObject("CDONTS.NewMail")<BR> mail.From = ""<BR> mail.To = rs("email")<BR> mail.Subject = subject<BR> mail.Body = message & rs("email")<BR> mail.Send<BR> Set mail = Nothing<BR> no = no + 1<BR> rs.MoveNext<BR>Wend<BR>&#039; When messages have been sent to all the users, exit<BR>Response.Write "E-mails sent to " & no & " users."<BR><BR>Best regards,<BR>-Paul<BR>Web Database Developer<BR>To help you put live data on the Web...<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default also..

    .. if you&#039;re simply trying to send the same email to multiple people you don&#039;t have to create a whole bunch of unique CDONTS objects. just simply concatenate all emails together seperated by commas.<BR>note that if you&#039;re sending emails to multiple people, if you put all the email addresses in the BCC field, the users will only be able to view their own email, all the rest will not be shown...this makes people happy ;)<BR>you will probably have to put a dummy address in the TO field, just to make sure it sends off.<BR><BR>justin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts