Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 30th, 2007, 06:56 PM
Authorized User
 
Join Date: Apr 2006
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Default split email to diferent person

I have a dropdown state field in my form. if the user selects AZ or CA then a email gets generated to a particular person when they hit the submit form.If the user has selected PA or WA from the state drop-down then the email is sent to a different person.
So based on what state is selected, the email gets sent to the respective person.

I have wriiten the code, but am not sure, if it is correct.Can anybody please verify.
********************************
'create object of Mail
        set objNewMail = Server.CreateObject("CDONTS.NewMail")
            with objNewMail
            if state = "AZ" THEN
                .To = "abc@test.edu"
            ELSE IF state = "CA" THEN
                .TO = "def@test.edu"
            ELSE state = "PA"||"WA" THEN
                .TO = "ghi@test.edu"
                END IF
                .From = "scholarship@test.edu"
                .Subject = "Online Scholarship Submission Confirmation"
                .BodyFormat = 0
                .MailFormat = 0
                .Body = strMessage
                .Send
            End with

        set objNewmail = Nothing
        '************************************************* ************



 
Old January 30th, 2007, 07:20 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Try:

'create object of Mail
set objNewMail = Server.CreateObject("CDONTS.NewMail")
with objNewMail
   if (state = "AZ") THEN
      .To = "abc@test.edu"
   ELSEIF (state = "CA") THEN
      .TO = "def@test.edu"
   ELSE (state = "PA") OR (state = "WA") THEN
      .TO = "ghi@test.edu"
   END IF
   .From = "scholarship@test.edu"
   .Subject = "Online Scholarship Submission Confirmation"
   .BodyFormat = 0
   .MailFormat = 0
   .Body = strMessage
   .Send
End with
set objNewmail = Nothing

Wind is your friend
Matt
 
Old February 5th, 2007, 07:54 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default

Hope that helps:

http://www.ithighway.co.uk/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Predefined xml schema for "Person" alexg313 XML 0 September 30th, 2005 03:01 PM
Split crmpicco VB How-To 6 May 17th, 2005 04:16 AM
problems working two person on same project debuajm General .NET 5 June 11th, 2004 01:37 PM
Messages between diferent programs deputy VB.NET 2002/2003 Basics 1 May 13th, 2004 08:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.