Sending email using CDOSYS - Do While Loop

How do I correct insert the do while loop in this statement?


ObjSendMail.HTMLBody = "<table style='font-family:Arial, Helvetica, sans-serif' width='600'> "_
& "<tr><td colspan=2>If you are interested in this vendor, you may contact them with the information below. Also, to grant web access to the vendor, please forward this email to mfinocchio@dwhomes.com. </td></tr> "_
& "<tr><td colspan=2>&nbsp;</td></tr> "_
& "<tr><td>Company:</td><td>" & request("company_name") & "</td></tr> "_
do while not what.eof
      & "<tr><td>Occupation:</td><td>" & what("name") & "</td></tr> "_
      what.movenext
loop
& "<tr><td>Name:</td><td>" & request("contact_f_name") & " " & request("contact_l_name")& "</td></tr> "_
& "<tr><td>Address:</td><td>" & request("address") & "</td></tr> "_
& "<tr><td>City, State, Zip:</td><td>" & request("city") & ", " & request("state") & " " & request("zip") & "</td></tr> "_
& "<tr><td>Phone:</td><td>" & request("contact_phone") & "</td></tr> "_
& "<tr><td>Mobile:</td><td>" & request("mobile_phone") & "</td></tr> "_
& "<tr><td>Fax:</td><td>" & request("fax_phone") & "</td></tr> "_
& "<tr><td>email:</td><td>" & request("email") & "</td></tr> "_
& "<tr><td>Supervisor's Name:</td><td>" & request("supervisor_name") & "</td></tr> "_
& "</table>"
mfinoccAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
ObjSendMail.HTMLBody = "<table style='font-family:Arial, Helvetica, sans-serif' width='600'> "_
& "<tr><td colspan=2>If you are interested in this vendor, you may contact them with the information below. Also, to grant web access to the vendor, please forward this email to mfinocchio@dwhomes.com. </td></tr> "_
& "<tr><td colspan=2>&nbsp;</td></tr> "_
& "<tr><td>Company:</td><td>" & request("company_name") & "</td></tr> "
do while not what.eof
      ObjSendMail.HTMLBody = ObjSendMail.HTMLBody & "<tr><td>Occupation:</td><td>" & what("name") & "</td></tr> "
      what.movenext
loop
ObjSendMail.HTMLBody = ObjSendMail.HTMLBody & "<tr><td>Name:</td><td>" & request("contact_f_name") & " " & request("contact_l_name")& "</td></tr> "_
& "<tr><td>Address:</td><td>" & request("address") & "</td></tr> "_
& "<tr><td>City, State, Zip:</td><td>" & request("city") & ", " & request("state") & " " & request("zip") & "</td></tr> "_
& "<tr><td>Phone:</td><td>" & request("contact_phone") & "</td></tr> "_
& "<tr><td>Mobile:</td><td>" & request("mobile_phone") & "</td></tr> "_
& "<tr><td>Fax:</td><td>" & request("fax_phone") & "</td></tr> "_
& "<tr><td>email:</td><td>" & request("email") & "</td></tr> "_
& "<tr><td>Supervisor's Name:</td><td>" & request("supervisor_name") & "</td></tr> "_
& "</table>" 

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mfinoccAuthor Commented:
Thanks so much!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.