Problem with E-mail ??

Results 1 to 2 of 2

Thread: Problem with E-mail ??

  1. #1
    Join Date
    Dec 1969

    Default Problem with E-mail ??

    Hi,<BR>I was trying to send a mail to a group whose mail ids are collected from a recordset. Code is as below. The problem with this code is it is sending mail to the first mailid contained in the variable "mailer". Could you please help me out on how I can place double quotes so that the mail will be sent to the group.<BR>&#060;%<BR>dim sbody<BR>dim strsql<BR>dim mailer<BR><BR>set objnewmail = server.CreateObject("CDONTS.newmail")<BR>objnewmai l.From = ""<BR><BR>set rsmail = Server.CreateObject("ADODB.Recordset")<BR>strSQL = "SELECT * FROM tblSalesRep WHERE MgrID = &#039;" & Session("MgrID") & "&#039;"<BR>rsmail.Open strSQL, conn<BR> <BR> If not rsmail.EOF then<BR> Do while not rsmail.EOF<BR> mailer = mailer & rsmail("Email") & ","<BR> rsmail.movenext<BR> Loop<BR> Else<BR> Response.write "No mailing addresses available"<BR> End If<BR> rsmail.close<BR> set rsmail = nothing<BR><BR>Response.write mailer<BR>objnewmail.To = mailer<BR>objnewmail.Subject = Request.Form("Subject")<BR>sbody = Request.Form("Message")<BR><BR>objnewmail.body = sbody<BR>objnewmail.send<BR>set objnewmail = nothing<BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Problem with E-mail ??

    Make a Response.Write inside your loop<BR><BR>Do while not rsmail.EOF<BR><BR>&#039;--&#062;Response.Write "Email : " & rsmail("Email") & "<BR>"<BR><BR>mailer = mailer & rsmail("Email") & ","<BR>rsmail.movenext<BR>Loop<BR>

Posting Permissions

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