Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Something weird in my code, please take a look...
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

chinh10
Junior Member

125 Posts

Posted - 19 May 2001 :  14:13:34  Show Profile
Please help me,
Could somebody take a look of this code, I don't know why when I select 'approved', everything is OK, but when I am 'disapprove', I did not receive email from this code?
 
<%
If (cStr(Request("Submit")) <> "") Then
If Request("charliesapproval") = "1" Then
Dim usxCDO
Dim id
Dim email
id = Request.QueryString("userid")
email = Request.Form("email")
Set usxCDO = Server.CreateObject("CDONTS.NewMail")
usxCDO.From = "ckhuc@fs.fujitsu.com"
usxCDO.To = "chinh11@hotmail.com"
usxCDO.CC = "chinh11@hotmail.com"
usxCDO.Subject = "Sending for your approval"
usxCDO.Body = "Please take a look at this:" & Chr(13) & Chr(10) &_
"http://133.164.254.57/fs-forms/mom.asp?userid=" & id
usxCDO.Send
Else
Set usxCDO = Server.CreateObject("CDONTS.NewMail")
usxCDO.From = "chinh11@hotmail.com"
usxCDO.To = email
usxCDO.Subject = "Form not Approved"
usxCDO.Body = "Your form has not been approved. Please submit a new one."
usxCDO.Send
Set usxCDO = Nothing
End If
End If
%>


e3stone
Average Member

USA
885 Posts

Posted - 19 May 2001 :  14:57:06  Show Profile  Send e3stone an AOL message
Because you're assigning the email variable inside the "if" statement, so it only get assigned when "charliesapproval" equals 1. Try placing the If statement after the variable declarations.

<%If (cStr(Request("Submit")) <> "") Then
Dim usxCDO
Dim id
Dim email
id = Request.QueryString("userid")
email = Request.Form("email")
Set usxCDO = Server.CreateObject("CDONTS.NewMail")

If Request("charliesapproval") = "1" Then
usxCDO.From = "ckhuc@fs.fujitsu.com"
usxCDO.To = "chinh11@hotmail.com"
usxCDO.CC = "chinh11@hotmail.com"
usxCDO.Subject = "Sending for your approval"
usxCDO.Body = "Please take a look at this:" & Chr(13) & Chr(10) &_
"http://133.164.254.57/fs-forms/mom.asp?userid=" & id
usxCDO.Send

Else

usxCDO.From = "chinh11@hotmail.com"
usxCDO.To = email
usxCDO.Subject = "Form not Approved"
usxCDO.Body = "Your form has not been approved. Please submit a new one."
usxCDO.Send
End If

Set usxCDO = Nothing
End If
%>

<-- Eric -->


http://insidewaco.com/forum/home.asp
Go to Top of Page

chinh10
Junior Member

125 Posts

Posted - 19 May 2001 :  16:52:54  Show Profile
Yes, It works
Thank you very much
You are my life saver

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.23 seconds. Powered By: Snitz Forums 2000 Version 3.4.07