Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 4th, 2005, 02:20 PM
Authorized User
 
Join Date: Aug 2005
Location: , , Canada.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sending Web based email to multiple people

Hello,

Does anyone know the process as to how to send HTML Web based email to a group of people. I have a database of 20 names and email addresses. I would like to send an email to each of them with their name inserted. Also I would like the email to look like a webpage with Tables.

Can anyone point me in the right direction as to how I can do this?

thanks,

Ray

  #2 (permalink)  
Old October 5th, 2005, 06:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Melbourne, Vic, Australia.
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code:
sMsg = "<table><tr><td>SomeHTML stuff</td></tr></table>"
Do While Not Rs.EOF
 SendEmail Rs("Name"), "your@email", "some Subject", "Dear " & Rs("Name") & sMsg
 Rs.MoveNext
Loop

Function SendEmail(sTo, sFrom, sSubject, sBody, sAttach)
Dim objCDO

'Create a new CDO objects
Set objCDO = Server.CreateObject("CDONTS.NewMail")

'Enter the sender's email address 
objCDO.To = sTo

'Enter the recipients of this email, use ; to separate the addresses
objCDO.From = sFrom

'Enter the subject of this email
objCDO.Subject = sSubject


objCDO.BodyFormat = 0 'CdoBodyFormatHTML
objCDO.MailFormat = 0 'CdoMailFormatMime

objCDO.AddAttachment(sAttach)

'Enter the body text of the message
objCDO.Body = sBody

'Send the email!
objCDO.Send

'Release the object 
set objCDO=nothing
End Function
I am a loud man with a very large hat. This means I am in charge


Similar Threads
Thread Thread Starter Forum Replies Last Post
sending email based on form value stecol Classic ASP Professional 0 February 1st, 2007 10:21 AM
Need Help in sending email khalidj06 Forum and Wrox.com Feedback 6 April 14th, 2006 08:16 AM
email sending msrnivas .NET Web Services 6 June 26th, 2004 06:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.