Web Design Forum  
 
Go Back   Web Design Forum > Web Software > Scripts

Reply
 
LinkBack Thread Tools Display Modes
Old 12-11-2004, 03:26 PM   #1 (permalink)
New Member
 
Join Date: Aug 2004
Posts: 12
Default Problem with ASP-mailing program

I have a curious error when running an ASP script that sends e-mails to our subscribers (the script is from Ocean12). There are almost 15.000 subscribers and the script worked fine until something was upgraded on the server. Now the script runs very slow (about 10x slower than before) and at a certain moment (after sending about 1/3 of mails) it gives this error and stops:
Code:
Persits.MailSender.4 error '800a0006' 
501 Syntax error 
/ocean_mail/send2.asp, line 69
It can't be a syntax error, since it worked fine before for years.
It can't be caused by a bad mail-address either, since I managed to send out our newsletter without any problem by splitting up the database in 10 smaller database containing 1.500 addresses each.
The webmaster said that there's nothing wrong with the server's software... Then what the hell could cause this error?
Lorand is offline   Reply With Quote
Old 12-11-2004, 07:10 PM   #2 (permalink)
Super Noob
 
zkiller's Avatar
 
Join Date: Aug 2004
Location: position:relative
Posts: 1,560
Send a message via AIM to zkiller Send a message via Yahoo to zkiller
Default

what's on line 69 of that file? i'd be more than happy to help you out, but it's kind of hard when i don't really know anything about the code you are running.

sorry, i am to lazy to download and install the script...
__________________
Stefan, the Post Master

Track Devil - May the boost be with you!
zkiller is offline   Reply With Quote
Old 12-11-2004, 07:15 PM   #3 (permalink)
New Member
 
Join Date: Aug 2004
Posts: 12
Default

Sorry, I forgot to post that part of the script. Here it is:
Code:
	Do While Not RS.eof
		Set mailObj = Server.CreateObject("Persits.MailSender")
		mailObj.Host = RSBODY("SMTP")
		mailObj.From = RSBODY("From_Email")
		mailObj.FromName = "From_Name"
		mailObj.AddAddress RS("Email")
		mailObj.Subject = Request("Subject")
		mailObj.Body = Request("Body")
		If (Request("Format") = "Text") Then
			mailObj.IsHTML = False
		Else
			mailObj.IsHTML = True
		End If
		mailObj.Send
		RS.movenext
	Loop
(The line 69 is in boldface.)
Lorand is offline   Reply With Quote
Old 12-12-2004, 07:40 PM   #4 (permalink)
Super Noob
 
zkiller's Avatar
 
Join Date: Aug 2004
Location: position:relative
Posts: 1,560
Send a message via AIM to zkiller Send a message via Yahoo to zkiller
Default

well, to be honest, i have no clue where you are getting the syntax error from since it doesn't do it with smaller databases. however, i did download the script and took a look at it and although it is quite feature rich, i found that they got a bit sloopy with the code in some instances. i doubt that that is the problem, but you never know. for instance, it should not be RSBODY("SMTP") as it is missing a part. it should look more like this... RSBODY.Fields("SMTP"). but like i said, i doubt that that's where the problem is coming from though. what are you using for a database? if you are using a access database, i recommend upgrading to either MySQL or MS SQL if at all possible, since your database is getting rather large. this would help a lot with the speed factor and would be much more stable as well.
__________________
Stefan, the Post Master

Track Devil - May the boost be with you!
zkiller is offline   Reply With Quote
Old 12-12-2004, 07:42 PM   #5 (permalink)
Super Noob
 
zkiller's Avatar
 
Join Date: Aug 2004
Location: position:relative
Posts: 1,560
Send a message via AIM to zkiller Send a message via Yahoo to zkiller
Default

you may want to try and contact the maker of the aspemail component about this. who knows, it may be a known problem with the version of the script or component you are using. although persits component are usually pretty good.
__________________
Stefan, the Post Master

Track Devil - May the boost be with you!
zkiller is offline   Reply With Quote
Old 12-12-2004, 09:59 PM   #6 (permalink)
New Member
 
Join Date: Aug 2004
Posts: 12
Default

I use an Access database, but that wouldn't be a problem, since it worked well a couple of months ago. Then the sending of 15.000 mails was completed in approx. 15 minutes. Now it spends 15-20 minutes sending only 1.500 mails...
The script timeout is set to 1.000.000 seconds, so the error can't be caused by timeout either.
The RSBODY.Fields("SMTP") is the value of the "SMTP" field from the database, it's the server's SMTP server address. If it would be wrong or missing, not a single mail would be sent from the server.
So I think it's something wrong on the server. What program could interfere with this script?
I know that if a mail address is not accepted a solution would be inserting the line "On error resume next" before that "mailObj.Send". That would prevent the error message, but how can I be certain that only that particular mail wouldn't be sent?
Is there an easy way to get some feedback from that script (e.g. a list of all skipped addresses)?
Lorand is offline   Reply With Quote
Old 12-13-2004, 07:35 PM   #7 (permalink)
Super Noob
 
zkiller's Avatar
 
Join Date: Aug 2004
Location: position:relative
Posts: 1,560
Send a message via AIM to zkiller Send a message via Yahoo to zkiller
Default

i think you missread my first message. anyways...

access isn't a good choice for large databases. they tend to crap out or get really slow as they grow. they are really just meant for smaller office applications.

it's not a server side error. like the error says, it's a syntax error, meaning that the contents of the varibles passed thru the script are either wrong, or contain something that the script has a problem processing.

the best way to trouble shot is to have the contents of the variables printed on screen. that will tell you where the script stops and came up with the error message and will help you determin where the syntax error is coming from precisely.
__________________
Stefan, the Post Master

Track Devil - May the boost be with you!
zkiller is offline   Reply With Quote
Old 01-04-2005, 10:31 AM   #8 (permalink)
New Member
 
Join Date: Aug 2004
Posts: 12
Default

I'll go with "On error resume next" before the "mailObj.Send" command. So the script will no longer stop on errors.
But how can i output the parameters that would cause the error? Every time the "mailObj.Send" command is not executed I want his parameters listed.
Lorand is offline   Reply With Quote
Old 01-04-2005, 11:25 PM   #9 (permalink)
Super Noob
 
zkiller's Avatar
 
Join Date: Aug 2004
Location: position:relative
Posts: 1,560
Send a message via AIM to zkiller Send a message via Yahoo to zkiller
Default

ok, i made some remarks and changes in bold to your code, maybe that will help explain what i tried to explain before.

Code:
	Set mailObj = Server.CreateObject("Persits.MailSender")
        ' you should create the object before the loop. no need to do it over and over
        ' again. the object only needs to created once.

	Do While Not RS.eof
		mailObj.Host = RSBODY.Fields("SMTP")
		mailObj.From = RSBODY.Fields("From_Email")
		mailObj.FromName = "From_Name" ' where is this variable coming from? is it a constant within the code?
		mailObj.AddAddress RS.Fields("Email")
		mailObj.Subject = Request("Subject") ' is this variable being passed via "GET" or "POST" 
		mailObj.Body = Request("Body") ' is this variable being passed via "GET" or "POST" 
		If (Request("Format") = "Text") Then
			mailObj.IsHTML = False ' is this variable being passed via "GET" or "POST" 
		Else
			mailObj.IsHTML = True ' is this variable being passed via "GET" or "POST" 
		End If
		mailObj.Send
		RS.movenext
	Loop
as for trouble shooting and firguring out where the error is coming from, i would simply add a request.write within the loop before the mailobj.send, containing all of the variables being passed to the mailobj to send. it won't look pretty, but it gets the job done and once you figure out wether that's the problem or not, you can simple comment the line out. when troubleshooting you always want to print as much information as you can get on the screen, so you can follow what the script is doing step for step.

i don't know much about the mail object that you are using, but you may want to check persists web site. i built a mail script a while back using smartaspmail (i believe that's what it is called) a while back. it had a function built into it to where when a error accured it would give you an error code with short description and you could also tell it what to do in case of an error, which in your case would be to display the contents of the variables being passed.

i know i haven't been of much help to you, but as both you and i have said, i doubt it's a problem with the script. :shrug:
__________________
Stefan, the Post Master

Track Devil - May the boost be with you!
zkiller is offline   Reply With Quote
Old 01-19-2005, 11:52 PM   #10 (permalink)
New Member
 
Join Date: Aug 2004
Posts: 12
Default

I solved the problem!
Here's the part of the code that was rewritten:
Code:
On Error Resume Next
mailObj.Send
If Err.number <> 0 then 
response.write("Error at address: '" & RS("Email") & "'<br>")
End If
And surprise: there was a bad e-mail address in the list. In fact it was a blank cell in the database. Don't know how it got there and why didn't see that before...
Lorand is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:12 PM.


Computer Forum - Internet Business - Webpage Design

 
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.