ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old March 19th, 2008, 11:58 AM
bcwjonline bcwjonline is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 6 bcwjonline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 49 m 43 sec
Reputation Power: 0
Classic ASP/VBScript - 2 Email Error

I was wondering if someone could help me - I have this code run after a user makes changes to a record in my database... It runs just fine - HOWEVER, it sends two (2) emails?!?!? Here's the code - is there anything I've done wrong, or what do you think the problem is?

<%



Set objErrMail= Server.CreateObject("CDO.Message")
With objErrMail
.From = "Webmaster@bootcampwithjess.com"
.To = "admin@bootcampwithjess.com"
.Subject = "BCWJ Admin Login"
.HTMLBody = CStr("Records DB has been updated by User " & Request.QueryString("Name") & " logged on at " & now())
.Configuration.Fields.Item ("http:// schemas. microsoft. com/cdo/configuration/sendusing") = 2
.Configuration.Fields.Item("http:// schemas. microsoft. com/cdo/configuration/smtpserver") = "smtp.bootcampwithjess.com"
.Configuration.Fields.Item("http:// schemas. microsoft. com/cdo/configuration/smtpserverport") = 25
.Configuration.Fields.Update
.Send
End With
Set objErrMail=nothing

Response.Redirect ("hidden")

%>

Reply With Quote
  #2  
Old March 20th, 2008, 02:19 AM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
Click here for more information.
 
Join Date: Feb 2005
Location: Dreamland
Posts: 12,645 mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)mehere User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 4 Months 3 Weeks 5 Days 18 h 58 m 26 sec
Reputation Power: 1542
-->Thread moved to ASP Forum. The Code Bank is for sample code only,
__________________
Come JOIN the party!!!

Quote of the Month:
Stupidity: Quitters never win, winners never quit, but those who never win AND never quit are idiots.

Questions to Ponder:
If man evolved from monkeys and apes, why do we still have monkeys and apes?

iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright© 2008 sbenj69

Reply With Quote
  #3  
Old March 20th, 2008, 04:01 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information. Click here for more information
 
Join Date: Jan 2005
Location: India
Posts: 10,179 micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 3 Months 3 Weeks 1 Day 16 h 36 m 26 sec
Reputation Power: 1427
the code looks fine!!
may be there is more code thats doing it!!
__________________
Laziness is my religion and Sunday is my God

Get the Mantra!

Reply With Quote
  #4  
Old March 20th, 2008, 05:29 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,618 Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 4 Days 13 h 39 m 41 sec
Reputation Power: 1429
there is nothing wrong with the code.
the problem is that it's being called twice.
it can occur for great many reasons, even if in your page you
have an empty image:
Code:
<%
...
%>
<img src="" />

having the blank image will cause the ASP code to run twice because
the "default" source of image is the current page.

Reply With Quote
  #5  
Old March 20th, 2008, 08:16 AM
bcwjonline bcwjonline is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 6 bcwjonline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 49 m 43 sec
Reputation Power: 0
Quote:
Originally Posted by Shadow Wizard
there is nothing wrong with the code.
the problem is that it's being called twice.
it can occur for great many reasons, even if in your page you
have an empty image:
Code:
<%
...
%>
<img src="" />

having the blank image will cause the ASP code to run twice because
the "default" source of image is the current page.


Thanks for the helpful idea's - I'll try adding an img file and actually attach an image. I'll let you know how it goes.

Reply With Quote
  #6  
Old March 20th, 2008, 02:52 PM
bcwjonline bcwjonline is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 6 bcwjonline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 49 m 43 sec
Reputation Power: 0
Quote:
Originally Posted by Shadow Wizard
there is nothing wrong with the code.
the problem is that it's being called twice.
it can occur for great many reasons, even if in your page you
have an empty image:
Code:
<%
...
%>
<img src="" />

having the blank image will cause the ASP code to run twice because
the "default" source of image is the current page.


I'm not sure where to look to change the "default" image of the page. the only code that runs on this page is what's quoted above. There is no HTML > it only redirects to the main landing page... Do you know what else I could try?

Reply With Quote
  #7  
Old March 20th, 2008, 03:03 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,618 Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 4 Days 13 h 39 m 41 sec
Reputation Power: 1429
you didn't understand me.
all I said is that among the possible reasons why code will be called twice,
there is one reason which is if you have blank image in your page.

this is only one possible reason. other possible reasons are: user simply
reload the page; spam bots; other page calling that code too.. it's endless.

Reply With Quote
  #8  
Old March 20th, 2008, 03:10 PM
bcwjonline bcwjonline is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 6 bcwjonline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 49 m 43 sec
Reputation Power: 0
Quote:
Originally Posted by Shadow Wizard
you didn't understand me.
all I said is that among the possible reasons why code will be called twice,
there is one reason which is if you have blank image in your page.

this is only one possible reason. other possible reasons are: user simply
reload the page; spam bots; other page calling that code too.. it's endless.

Okay - Thanks... Back to the drawing board for me.

Reply With Quote
  #9  
Old March 20th, 2008, 03:15 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,618 Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 4 Days 13 h 39 m 41 sec
Reputation Power: 1429
try to debug this issue by logging the visitor who executed that code.
you can log the IP address and the referer, for example.

Reply With Quote
  #10  
Old March 20th, 2008, 03:28 PM
bcwjonline bcwjonline is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 6 bcwjonline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 49 m 43 sec
Reputation Power: 0
Quote:
Originally Posted by Shadow Wizard
try to debug this issue by logging the visitor who executed that code.
you can log the IP address and the referer, for example.


Good idea! However, it's on every login request from ALL users. Including myself...
What makes this problem even more confusing is this problem just recently started to happen... I'm trying to remember if there were any changes I made to the server settings recently that would cause this problem, but nothing is coming to mind. Except the requests are coming from the internet no longer our intranet... would that have anything to do with it?

Reply With Quote
  #11  
Old March 21st, 2008, 12:48 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,618 Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 4 Days 13 h 39 m 41 sec
Reputation Power: 1429
you can cure the symptoms by adding this code on top of your current code:
Code:
If Session("current_name") = Request.QueryString("Name") Then
   Response.Write("you have already been here, thanks.")
   Response.END
Else  
   Session("current_name") = Request.QueryString("Name")
End If

this will prevent duplicates by setting session variable then checking for it.
however this is like aspirin: it won't cure the root of the problem to find it
you'll have to investigate this much further.

Reply With Quote
  #12  
Old April 6th, 2008, 03:14 AM
saturnx saturnx is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 10 saturnx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 28 sec
Reputation Power: 0
Quote:
Originally Posted by bcwjonline
Good idea! However, it's on every login request from ALL users. Including myself...
What makes this problem even more confusing is this problem just recently started to happen... I'm trying to remember if there were any changes I made to the server settings recently that would cause this problem, but nothing is coming to mind. Except the requests are coming from the internet no longer our intranet... would that have anything to do with it?


Hi... if i understood correctly, this email will send an email to the admin informing that this user is now logged in the system etc etc and that this happens on login. Check your log in section of code. Maybe you accidentally got it to send out an email even when it was a failed login (wrong password, username, etc) even though nothing has updated the DB. Check also if it was placed into a loop in your validation?

Reply With Quote