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

Script Running twice

Status
Not open for further replies.

nicklieb

Programmer
Oct 17, 2002
383
GB
Hi All,


I have a real problem, for some reason my script seems to be running twice.

The script pumps out an email with data drawn from database.

The first email comes through correctly with all fields populated correctly. Then a second email comes through, with all the field empty.

This is a real problem as this email will be sent to a fax service, so I do not want an empty email going to this service.

The only change that I have made was to add in Session variables.

Does anyone know if there is a bug with Session and processing of scripts

If you really want the script I can post, but it;s pretty straight forward.
 
Code:
repair_id = request("repair_id")
company_id = request("company_id")

%>
<!--#include file="faxingsheet.asp"-->
<%
    stmt_get_fax = "Select contact_fax from apple_company where company_id='" & company_id & "'"
    
    set objRS_fax = conn.Execute(stmt_get_fax)
    while not objRS_fax.EOF
		contact_fax = objRS_fax("contact_fax")
		objRS_fax.Movenext
	wend
	set objRS_fax = Nothing
    
    
     Dim objCDOSYSCon 
		'Create the e-mail server object 
		Set objCDOSYSMail = Server.CreateObject("CDO.Message") 
		Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration") 
		'Out going SMTP server 
		'mailsweeper
		'objCDOSYSCon.Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "10.60.10.17" 
		'exch
		objCDOSYSCon.Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = "10.61.100.1" 

		objCDOSYSCon.Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] = 25 
		objCDOSYSCon.Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 2 
		objCDOSYSCon.Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")[/URL] = 60 
	objCDOSYSCon.Fields.Update 
	'Update the CDOSYS Configuration 
Set objCDOSYSMail.Configuration = objCDOSYSCon 
objCDOSYSMail.From = "webmaster@crc-group.com"
objCDOSYSMail.To = "nick.liebmann@crc-group.com"
'----------------------------------------
'This is the the fax number to be used in live
'objCDOSYSMail.To = replace(contact_fax, " ", "") & "@fax.tc"
'----------------------
'
objCDOSYSMail.Subject = "Receipt and UPS label fax to " & contact_fax
objCDOSYSMail.HTMLBody = fax_out
'Send the e-mail
objCDOSYSMail.Send
'Close the server mail object 
Set objCDOSYSMail = Nothing 
Set objCDOSYSCon = Nothing

now this problem only started to occur when I introduced a Session Variable.

Faxing_sheet.asp is a file that renders out the email to the faxing server.
 
are you using CDO in the other .asp? If that is the change that caused this behavior then it sounds like you have another .send in there to get it to the fax

 
no there is other .send whatso ever..


It's really strange and is annoying the hell out of me, I'm wondering if it;s a Windows 2003 bug with Session variables, as it's only occured since i usede the sessions....
 
no bugs in session state that I know of. Are you running IIS 6 or 5.1?

How are you sending the fax? What is the session variable doing that you think is subject to the problem? can you post the fax portion of the other file? not the complete script but the portion that is doing the work

 
I'm sending the fax by email to a fax service. ( soon to replaced with out own fax server)

I can't really post the fax script. But I can tell you that all I do is to perform a database call and use the recordset and pull out fields that are then rendered into a string that is sent via CDO.

I'm running IIS 6 on 2003. The session variable is set when a user logs in.

This script is very simple really.
 
no there isn't another .send. What I meant was the faxing sheet creates the string for the cdo.send that I posted at top .
 
I've found the problem and it had nothing to do with the any of the script.

In a menu I had in a tag background="#".

this was causing the page to reload. VERY VERY wierd..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top