Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Sending Batch Email From Database List

Explorer ,
Jun 06, 2006 Jun 06, 2006
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 (for email address) with unbound 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 might do this in general terms - I am reasonably versed in VBScript and the use of DW as well as sending emails via CDONTS as well as CDOSYS, just not quite sure on how to go about it that all.

Thanks
Dave
TOPICS
Server side applications
637
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jun 06, 2006 Jun 06, 2006
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"...
Translate
LEGEND ,
Jun 06, 2006 Jun 06, 2006
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
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 07, 2006 Jun 07, 2006
Thanks, Paul, what a fantastic reply .. most grateful .. can see why u r down as an Expert now .. wow!! Regards, Dave
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 07, 2006 Jun 07, 2006
> All you need to is create a recordset script that will output the=20
> infromation you need and then create a repeat region. In side of that =
repeat=20
> region you would code a CDO mail script which will do the actual =
mailing.

Most shared hosting providers don't allow sending large numbers of =
emails, so depending on the number of recipients in the database this =
route may be troublesome in that respect.

Do you have any idea what is generally accepted as a "safe" amount of =
mails to send off in one batch?

--=20
Marja de Vroed
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 07, 2006 Jun 07, 2006
Thanks, I think Paul pipped u at the post, but he might be able to answer your point on what is considered excessive. Trgards, Dave.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 07, 2006 Jun 07, 2006
I guess that will depend upon the host, and also if there are any timing
issues. If the page loops for a long time the server may think it has hung.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"Marja de Vroed" <marja@nospam.webwaresystems.nl> wrote in message
news:e66l19$c8h$1@forums.macromedia.com...
> 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.

Most shared hosting providers don't allow sending large numbers of emails,
so depending on the number of recipients in the database this route may be
troublesome in that respect.

Do you have any idea what is generally accepted as a "safe" amount of mails
to send off in one batch?

--
Marja de Vroed


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 08, 2006 Jun 08, 2006
LATEST
Hi Dave,

If you are prepared to consider a commercial solution then you might
like to take a look at the WebAssist extension, Universal Email.

To learn more about this powerful Dreamweaver extension, please the
visit web address I have listed below:

http://www.webassist.com/professional/products/productdetails.asp?PID=13

If this doesn't suite your requirements then an alternative would be to
consider signing up to the Constant Contact Email Service combined with
our free Constant Contact Join My Mailing List extension.

To learn more about this extension take a look at this URL.
http://www.webassist.com/professional/products/productdetails.asp?PID=83

To learn more about the the Constant Contact Email Service, point your
web browser here:

http://www.constantcontact.com/index.jsp

Please feel free to contact me off-list if you would like any more
information about these or any other products from the WebAssist tool chest.

Regards,
Mark

----------------------------------
Mark Fletcher
WebAssist.com
----------------------------------




Dave(UK) wrote:
> 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
>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines