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:
  #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
ASP Free God 17th Plane (13000 - 13499 posts)
 
Join Date: Feb 2005
Location: Dreamland
Posts: 13,239 mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)mehere User rank is General 16th Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 5 Months 1 Day 20 h 18 m 30 sec
Reputation Power: 2037
-->Thread moved to ASP Forum. The Code Bank is for sample code only,
__________________
Come JOIN the party!!!

Quote of the Month:
Pretension: The downside of being better than everyone else is that people tend to assume you're pretentious.

Questions to Ponder:
You can be overwhelmed and underwhelmed, but why can't you be simply whelmed?

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: 12,685 micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)micky User rank is General 21st Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 5 Months 1 Week 5 Days 4 h 5 m 20 sec
Reputation Power: 2358
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: 29,262 Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)  Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 2 Days 32 m 33 sec
Reputation Power: 2509
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: 29,262 Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)  Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 2 Days 32 m 33 sec
Reputation Power: 2509
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: 29,262 Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)  Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 2 Days 32 m 33 sec
Reputation Power: 2509
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: 29,262 Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)  Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 2 Days 32 m 33 sec
Reputation Power: 2509
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: 14 saturnx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 17 m 32 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
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Classic ASP/VBScript - 2 Email Error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek