Ask a Question related to Macromedia Contribute General Discussion, Design and Development.
-
nightwolf666 #1
my mass mailer is not worikin
hi, i got one script from the internet and changed a little bit to work with
mass email system like sending 5 mails per refresh, but due to some cause mails
are not going..
what i am trying is making the field active set to 1 when mails are going and
then on page i have a check saying MailList.active NEQ 0
go to finish page..
it executes the query successfully but mails are not reaching me..
itested to using cfdump in all the ways but i do not what is the problem
causing a trouble to me/
and then on finish page setting the whole active to 0 again so that next user
wanna sent, they should go..
here is my code i am using to do?
<!--- <cfdump var="#url#"> --->
<!--- <cfquery datasource="#request.dsn#" username="#request.username#"
password="#request.password#" name="gavy">
Insert into tempnewsletter(tempID,name,email) select * FROM
newsletter_subscriptions
</cfquery>
--->
<cfset variables.errArray=ArrayNew(2)>
<!---
set the email address and server of the poor sap who gets
the email listing all of the errors. A way to make this
more robust is to keep the data in a database and simply
notify the designated sap that errors exist to review.
There are MANY useful things you can do with this error
information.
--->
<cfset variables.errEmail="ya@yes.com">
<cfset variables.errServer="ya@yes.com">
<!---
Run Rate is the number of seconds between refresh.
--->
<cfset variables.RunRate=5>
<!---
Query Run is the number of query rows (email addresses)
that will be processed on each execution of this template
--->
<cfset variables.QueryRun=5>
<!---
pull the ID field so we can get a record count.
--->
<cfquery name="MailList" datasource="#request.dsn#"
username="#request.username#" password="#request.password#">
select *
from table1
</cfquery>
<!---
Do some stuff to prevent page caching, which was found to
be a problem on some client browsers
--->
<cfheader
name="Expires"
value="#now()#">
<cfheader
name="Pragma"
value="no-cache">
<cfheader
name="cache-control"
value="no-cache, no-store, must-revalidate">
<!---
Are we there yet?
--->
<style type="text/css">
<!--
.style1 {font-weight: bold}
-->
</style>
<cfif MailList.active NEQ 0>
<!---
yes. Notify the email if there are any errors
--->
<cfif not ArrayIsEmpty(variables.errArray)>
<!---
The array is not empty so there must be errors. Send the
error email.
--->
<cfmail
to="yes@ya.com"
from="#variables.errEmail#"
subject="OOPS!"
server="#variables.errServer#"
username="me"
password=""
type="HTML">
Errors List<br>
<b>#variables.errArray#</b>
</cfmail>
</cfif>
<!---
finish the job by showing the "All Done" screen.
--->
<cflocation addtoken="no" url="finish.cfm">
<cfelse>
<!---
display the "in-progress" page
--->
<html>
<cfoutput>
<!---
This next line re-runs the template automatically at the run rate.
Note the UUID inserted into the url.
--->
<meta
http-equiv="REFRESH"
content="#variables.RunRate#;URL=#cgi.script_name# ?UniqueURL=#UrlEncodedFormat(C
reateUUID())#">
</cfoutput>
<head><title>Mass Emailer</title></head>
<!---
Send the actual mail.
--->
<!--- <cfparam name="getfileID" default="1"> --->
<!--- <cfdump var="#url#"> --->
<cfloop query="MailList" startrow="1" endrow="#variables.QueryRun#">
<cftry>
<cfquery name="sendnews" datasource="#request.dsn#"
username="#request.username#" password="#request.password#">
select *
from list
where id in (#url.newsid#)
</cfquery>
<Cfset emaillist = valuelist(MailList.email)>
<Cfset emailidlist = valuelist(MailList.id)>
<!--- <cfdump var="#emaillist#"> --->
<cfset a = "#listgetat(emaillist, b)#">
<cfdump var = "#a#">
<cfloop from="1" to="#listlen(emaillist)#" index="B">
<cfmail to="#listgetat(emaillist, b)#" from='me@mydomain.com'
subject="#sendnewsletters.subject#" type="HTML" server="yes@ya.com">
<link href="/_newsletter/style.css" rel="stylesheet" type="text/css">
<table width="747" border="0" align="center" class="border">
<tr>
<td><div align="center"><a href="##" target="_blank">
<img src="logo.gif" alt="" width="235" height="56" border="0"
/></a></div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>» <cfoutput><span
class="text">#ActivateURL(sendnews.header,'_blank' )#</span></cfoutput></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>» <font color="4D74B2"
class="text"><cfoutput>#ActivateURL(sendnews.subje ct,'_blank')#</cfoutput></font</tr>></td>
<tr>
<td> </td>
</tr>
<tr>
<td><div align="center">Welcome</div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><span
class="text"><cfoutput>#ActivateURL(sendnews.updat e_header,'_blank')#</cfoutput>
</span></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><cfoutput><span
class="text">#ActivateURL(sendnews.new_update,'_bl ank')#</span></cfoutput></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><cfoutput><span
class="text">#ActivateURL(sendnews.body,'_blank')# </span></cfoutput></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</tr>
<tr align="center" valign="top">
<td><a
href="unsubscribe.cfm?unsubscribe=#listgetat(email idlist,b)#">Unsubscribe</a></t
d>
</tr>
</table>
</cfmail>
</cfloop>
<cfcatch type="ANY">
<!---
if the cfmail statement throws an error it gets dealt with
here. First we append the ID and email address to the error
array.
--->
<cfset arrayAppend(variables.errArray[1],MailList.ID)>
<cfset arrayAppend(variables.errArray[2],MailList.email)>
</cfcatch>
</cftry>
<!---
now that the mail has either been sent or flagged as bad, delete
its database record
--->
<cfquery
datasource="#request.dsn#" username="#request.username#"
password="#request.password#">
Update table1
set active = 1
Where
ID =
<cfqueryparam
cfsqltype="CF_SQL_NUMERIC"
value="#MailList.ID#">
</cfquery>
</cfloop>
<!---
give the user a visual cue as to where the operation is at the moment.
You can get quite fancy here with pretty html and time-to-completion
calculations based on your record count, refresh rate etc.
--->
<cfset variables.LeftToGo=MailList.RecordCount-variables.QueryRun>
<cfoutput>
<p><b>Total left to send: #variables.LeftToGo#</b>.</p>
<p>Each run is #variables.RunRate# seconds apart.</p>
</cfoutput>
<p>Leave this system alone and wait for this job to complete.</p>
<p>Do not refresh the screen and do not Close it </p>
<p>When it finishes, you will be notified.</p>
</body></html>
</cfif>
nightwolf666 Guest
-
SMTPsvg.Mailer
Hi All, I know that the SMTPsvg.Mailer component is used to send mails from ASP Page. Can any body tell me where can I get the Component for... -
form mailer
I need some help. I created a form using dreamweaver (heres the link to the site and form http://www.brentwoodlivery.ca/evaluation ) Basically when... -
PHP Mailer
I would like to set up a PHP page which my staff can use to select attachments and send them to a specified email address. There will be a list... -
PHP mailer script
I would like to set up a PHP page which my staff can use to select attachments and send them to a specified email address. There will be a list... -
ASP Mailer Question
What is the **MOST** obvious reason why will this will fail (it's not syntax or anything specific to the object)? Function Mail(MailerProgram,...



Reply With Quote

