Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email all on database from web form? 1

Status
Not open for further replies.

bluepeter

Technical User
Feb 18, 2001
1
0
0
GB
Hi, I'm after code for emailing everyone in the email field of a database using a web form - i.e. subject and content is added using a form and all the email addresses are added from the database.
Thanks in advance
Richard
 
To email from a website, you need to use an ASP component that will send email. Most of the components have code like so:

EmailComponent.AddRecipient "bob@bob.com"

You could set up your code like so:

SQL = "SELECT emailfield from usertable order by emailfield"
rs.open SQL, Connection
While not rs.eof
if not rs(&quot;emailfield&quot;) <> &quot;&quot; then
EmailComponent.AddRecipient rs(&quot;emailfield&quot;)
end if
rs.movenext
wend

This will add all addresses in a field named email to an email component. ASPMail or JMail are two good ASP email components. You have to have them installed on your server though.

Hope that helps.
Harold Blackorby
hblackorby@scoreinteractive.com
St. Louis, MO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top