Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Re: loops and aspmail


Message #1 by "Sandra" <salau@p...> on Fri, 28 Jun 2002 18:39:23
> thanks to you guys I have a page where the results of a form are 
displayed 
using a for each loop like so:

for each x in request.form("checked")
   response.write "<p><b>" & x & "</b>" 
   if len(request.form("datefrom" & x)) <> 0 then 
      response.write " &nbsp;&nbsp; From: " & request.form("datefrom" & x)
   if len(request.form("dateto" & x)) <> 0 then     
      response.write "&nbsp;&nbsp; 
      To: " & request.form("dateto" & x) & "</p>"
next

> Is there a way that I can insert the same loop into an aspmail?

I would suggest using CDONTS if you have SMTP mail. Or you have the 
ASPMAIL component installed, then use that instead. Anyway, I don't see 
why not - 

for each ID in IDLIST
   set objMail = Server.CreateObject("CDONTS.NewMail")
   objMail.To = "recipient@m..."
   objMail.From = "sender@m..."
   objMail.Subject = "subject of mail"
   objMail.Body = "whatever you want to say
   objMail.Send
   set objMail = nothing
next

You should be safe as long as you continue to set objMail to nothing... 
but I haven't tried it out myself. 

HTH,
Sandra
Message #2 by "vic" <vweston@m...> on Thu, 27 Jun 2002 16:16:32
thanks to you guys I have a page where the results of a form are displayed 
using a for each loop like so:

for each x in request.form("checked")
response.write "<p><b>" & x & "</b>" 
if len(request.form("datefrom" & x)) <> 0 then response.write " 
&nbsp;&nbsp; From: " & request.form("datefrom" & x)
if len(request.form("dateto" & x)) <> 0 then response.write " &nbsp;&nbsp; 
To: " & request.form("dateto" & x) & "</p>"
next

Is there a way that I can insert the same loop into an aspmail?

  Return to Index