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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blank Messages with Mailing List

Status
Not open for further replies.

larryman

Programmer
Jun 16, 2000
63
0
0
US
Hi,

Could anybody help fathom what's wrong with this code, it's causing headache for me. It has been sending mails for almost one year to a mailing list of around 5,000. To my amazement the mails sent today contains no body as in the mails are blank. PLeaseeeeeeeeeee what could be the problem. Is it advisable to move this whole thing to a stored procedure on SQL Server. Becos it takes heaven to sent 5,000 mails in 30 mins

Code is Shown below
<% @Language=&quot;VBScript&quot;%>
<% Option Explicit%>
<%
Response.Buffer = True
'declare all local variables

dim dcnDB 'As ADO.Connection
dim strSQL 'As String
Dim Mymail 'As CDONTS component
Dim rs 'As recordset 2
dim Message_Title
Dim Message_Body
Dim Email
Dim Kount
Dim lastprocid
Dim Table
Dim name
'Create the Connection Object
%>

<%
Set dcnDB = Server.CreateObject(&quot;ADODB.Connection&quot;)
dcnDB.ConnectionString = &quot;Provider=Microsoft.Jet.OLEDB.4.0;&quot;_
& &quot;Data Source=\\premfs5\sites\premium10\oysterbar\Database\success.mdb&quot;
dcnDB.Open

'f:\Aspdatabase\Database\success.mdb

'Create the recordset object



If Request.QueryString(&quot;lastProc&quot;) <> &quot;&quot; Then

strSQL = &quot;SELECT Top 100 * FROM Mailinglist WHERE ID > &quot; & Request.QueryString(&quot;lastProc&quot;) & &quot; ORDER BY ID&quot;
lastprocid = Request.QueryString(&quot;lastProc&quot;) + 100

Else
strSQL = &quot;SELECT TOP 100 * FROM Mailinglist ORDER BY ID&quot;
lastprocid = 100
Response.Cookies(&quot;Title&quot;) = Request.Form(&quot;Category_Title&quot;)
Response.Cookies(&quot;Message&quot;) = Request.Form(&quot;Category_Message&quot;)
Response.Cookies(&quot;name&quot;)=Request.QueryString(&quot;Name&quot;)

End If



Set rs = dcnDB.Execute(StrSQL)

'Message_Title = Request.Form(&quot;Category_Title&quot;)
'Message_Body = Request.Form(&quot;Category_Message&quot;)

If rs.EOF Then
name = Request.Cookies(&quot;name&quot;)
Response.Redirect &quot;sendmessage3.asp?Name=&quot; & Name &&quot;&quot;
End if

Do While NOT rs.EOF


Set myMail = CreateObject(&quot;CDONTS.NewMail&quot;)
myMail.From = &quot;successpower@samadeyemi.org&quot;
myMail.To = rs(&quot;email1&quot;)
myMail.Subject = Request.Cookies(&quot;Title&quot;)
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = Request.Cookies(&quot;Message&quot;)
'Replace(Message_Body,&quot;&quot;&quot;&quot;,&quot;\'&quot;)
'Replace(Message_Body, &quot;&&quot;&&quot;, &quot;)
myMail.Send



rs.MoveNext
Loop
%>

Thanks a bunch



Oysterbar ride to success. Keep Riding
 
Did you try doing a response.write on request.form(&quot;Category_Message&quot;) to see if anything is coming over? Can I ask why you are writing a cookie and then requesting the same cookie for the Body of your message? Also, you probably know this already but bodyformat=0 and mailformat=0 is for sending html.
 
You are setting Response.Cookies(&quot;Message&quot;) = Request.form(&quot;Category_Message&quot;), then you set the body of your message with myMail.Body = Request.Cookies(&quot;Message&quot;).

Why not just set myMail.Body = request(&quot;Category_Message&quot;)?


 
Veep,cglinn
I'm writing to the cookies because this pages refreshes itself so after the first time, the request.Form(element) goes away and it becomes blank. but if i request from the cookie, i could always get the info after the refresh.

Thanks

Oysterbar ride to success. Keep Riding
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top