Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


two conditions to help send email from ASP form

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,37627
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> two conditions to help send email from ASP form
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 two conditions to help send email from ASP form - 9/11/2006 7:53:20 AM   
  riedellphi

 

Posts: 7
Score: 0
Joined: 9/11/2006
Status: offline
I have a form that has two conditions to know who to send am email to. Some form fields are pre-popluated from a system.

There is a viewable text that is pre-populated (Full name) and text field to enter a new name. If the new name field changes, send email to Computer Support (CS) email address and person filling out form.
If new name field is equal to full name or is blank, send message to person filling out form.

Also, if Supervior radio button checked "Yes", send message to superviors email address and person filling out form.
If Supervior radio button checked "No", send message to person filling out form.

So it seems like there are four different conditions that i have to deal with
1. New name change and Supervisor checked "yes" - email sent to CS, Supervisor, and Person filling out form.
2. New name change and Supervisor checked "No" - email sent to CS and Person filling out form.
3. No Change in New name and Supervisor checked "Yes" - email sent to Supervisor and Person filling out form.
4. No Change in New name and Supervisor checked "No" - email sent to Person filling out form.

Is there a script that i can write to say who name gets put in the CC line of the email message that is created?

This is what i have so far, but doesn't seem to work:

cclist1 = emailAddressInfo
If fullNameInfo <> newNameInfo AND CopySupervisor = "Yes" then
    ccList = cclist1 &";CompSec@yahoo.com;"& supEmailInfo
Else if fullNameInfo = newNameInfo AND CopySupervisor = "Yes" then
    ccList = cclist1 &";"& supEmailInfo
Else if fullNameInfo <> newNameInfo AND CopySupervisor = "" then
    ccList = cclist1 &";CompSec@yahoo.com"
End if ccList = cclist1


Any help would be appreciated.  Thanks!
 
 
Post #: 1
 
 RE: two conditions to help send email from ASP form - 9/11/2006 8:13:35 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
I would recommend looking at the use of a bit mask for this. It looks like you have 3 potential people to send the email to. So, your bits could represent Supervisor, CS, and person respectively. So a value of 100 would email the super only, 101 would email the super and the person, etc. 

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to riedellphi)
 
 
Post #: 2
 
 RE: two conditions to help send email from ASP form - 9/11/2006 8:18:56 AM   
  riedellphi

 

Posts: 7
Score: 0
Joined: 9/11/2006
Status: offline
 
I am somwhat new into VB Scripting. I have inheritied these froms from another group.
Could you explain further on the value 100, 101, etc. to me.
Or is there a URL you could sned me for further explaination.
Thanks!

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: two conditions to help send email from ASP form - 9/11/2006 8:27:19 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
'First you would want to go through and check the conditions for each possibility:


Const SUPER = &h100
Const CS = &h010
Const PERSON = &h001

strTest = 0
'If the super radio button is pressed email the super
If CopySupervisor = "Yes" Then
    strTest = strTest + SUPER
End If
If
'If the name changed, email CS
If fullNameInfo <> newNameInfo Then
    strTest = strTest + CS
End If
'Always email the person
strTest = strTest + PERSON

'Then check the bit mask and add the proper people to the cc field
If strTest And SUPER Then
  WScript.Echo "Email Super"
End If
If strTest And CS Then
  WScript.Echo "Email CS"
End If
If strTest And PERSON Then
  WScript.Echo "Email Person"
End If

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to riedellphi)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> two conditions to help send email from ASP form Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts