Dave
All you need to is create a recordset script that will output
the
infromation you need and then create a repeat region. In side
of that repeat
region you would code a CDO mail script which will do the
actual mailing.
The script below is an example
<%@LANGUAGE="VBSCRIPT"%>
<!--#include virtual="/Connections/connAuto.asp" -->
<%
set rsMail = Server.CreateObject("ADODB.Recordset")
rsMail.ActiveConnection = MM_ConnAuto_STRING
rsMail.Source = "SELECT FirstName, UserEmail FROM
tblAutoLogin"
rsMail.CursorType = 0
rsMail.CursorLocation = 2
rsMail.LockType = 3
rsMail.Open()
rsMail_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rsMail_numRows = rsMail_numRows + Repeat1__numRows
%>
<% dim Subject
Subject = request.form("txtSubject")
%>
<%dim strAttachPath
if request.form("txtAttach") <> "" then
'strAttachPath = Server.MapPath ("/Admin/Autogates/Attach/")
&
request.form("txtAttach")
strAttachPath = "c:\websites\49728fda\Admin\Attach\" &
request.form("txtAttach")
end if
%>
<%
Dim objCDO, Mailbody, Email, iConf, Flds
'Const cdoSendUsingPort = 2
%>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsMail.EOF))
%>
<%
Email = rsMail.Fields.Item("UserEmail").Value
Mailbody = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0
Transitional//EN'>"
Mailbody = Mailbody & "<html>"
Mailbody = Mailbody & "<head>"
Mailbody = Mailbody & "<title>"
Mailbody = Mailbody & Subject
Mailbody = Mailbody & "</title>"
Mailbody = Mailbody & "</head>"
Mailbody = Mailbody & "<body bgcolor='#ffffff'>"
Mailbody = Mailbody & "<table width = '600' border='1'
color='red'
cellspacing='5'><tr><td>"
Mailbody = Mailbody & "<img src='
http://65.36.201.26/Admin/topbanner.gif'>"
Mailbody = Mailbody & "<p><br>"
Mailbody = Mailbody &
rsMail.Fields.Item("FirstName").Value
Mailbody = Mailbody & "<p>"
Mailbody = Mailbody &
Replace(request.form("txtMessage"),chr(13),"<br>")
Mailbody = Mailbody & "<p>Regards<br>Stephen
Hudson<br>Auto Gates Ltd.<br>"
Mailbody = Mailbody & "Auto Gates Limited.<br>"
Mailbody = Mailbody & "<a
href='
http://www.AutoGates.com'>www.AutoGates.com</a>"
Mailbody = Mailbody &
"</td></tr></table>"
Mailbody = Mailbody & "</body>"
Mailbody = Mailbody & "</html>"
Dim objMail
set objMail = Server.CreateObject("CDO.Message")
objMail.From = "Sales@Autogates.com"
objMail.To = Email
objMail.Subject = Subject
objMail.HtmlBody = MailBody
if request.form("txtAttach") <> "" then
objMail.AttachFile strAttachPath
End if
objMail.Send
set objMail = nothing
%>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsMail.MoveNext()
Wend
%>
<%Response.redirect ("index.asp")%>
--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver
Valleybiz Internet Design
www.valleybiz.net
"Dave(UK)" <webforumsuser@macromedia.com> wrote in
message
news:e63t56$nq9$1@forums.macromedia.com...
> Hi, Using DWMX VBScript .
>
> I have a MS Access database of customer names and email
addresses on my
> website server side.
>
> I want to create an asp page bound to the customer table
with textfields
> for
> me to put the email subject and body text.
>
> I then want to click a button and have the asp send each
of the customers
> the
> same email. I don't want to save the email details from
the from text
> boxes
> but can do if it helps.
>
> Has anyone any suffestions on how I kmight do this in
general terms - I am
> reasonably versed in VBScript and the use of DW, just
not quite sure on
> how to
> go about it that all.
>
> Thanks
> Dave
>