cdo using combo box in my form

Reply

Join Date: Dec 2004
Posts: 27
Reputation: faisyshah is an unknown quantity at this point 
Solved Threads: 0
faisyshah faisyshah is offline Offline
Light Poster

cdo using combo box in my form

 
0
  #1
Dec 20th, 2005
HEELO ,
in my asp form i have following fields
1)Name (text box)
2)Job Title (text box)
3)company name (text box)
4)email address (text box)
5)telephone (text box)
6)nature of enquiry (combo box)
combo box consist of following values
a)sales
2)technical service
3)web development
4)employment opportunities

basically my question relate from cdo. when user input all the fields and submit form i receive all the information by email.
for example user input in the text box and select one value from combo bax may be sales then i will receive all the user information in my sales email address.
i have 4 combo box values nad 4 email address.
therefore i want when user select 2) technical services from combo box then how i can receive all user information in my technical service email address.

similarly when user select 3)web development
from combo box then how i can receive all user information in my web development email address .

similarly when user select 4)employment opportunities
from combo box then how i can receive all user information in my employment opportunities email address .

please give me complete info with code.
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 131
Reputation: william_stam is an unknown quantity at this point 
Solved Threads: 2
william_stam's Avatar
william_stam william_stam is offline Offline
Junior Poster

Re: cdo using combo box in my form

 
0
  #2
Dec 24th, 2005
<form name="form1" method="post" action="">
<select name="select">
<option value="email1@something.com">email 1</option>
<option value="email2@something.com">email 2</option>
<option value="email3@something.com">email 3</option>
<option value="email4@something.com">email 4</option>
</select>
</form>

<% ' with the cdo script put "to" email address to the value of the select box %>
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 27
Reputation: faisyshah is an unknown quantity at this point 
Solved Threads: 0
faisyshah faisyshah is offline Offline
Light Poster

Re: cdo using combo box in my form

 
0
  #3
Dec 27th, 2005
sir i want to ask

<form name="form1" method="post" action="">
<select name="select">
<option value="Sales">Sales</option>
<option value="Technical Support">Technical Support</option>
<option value="Employment Opportunities">Employment Opportunities</option>
<option value="Web development">Web development</option>
</select>
</form>

now i have 4 email address according to option values

1)sales@dawn.com
2)support@dawn.com
3)jobs@dawn.com
4)web@dawn.com

a)now i want using cdo when customer select "sales" option then i receive customer info in to sales@dawn.com account,

b)using cdo when customer select "Technical support" option then i receive customer info in to support@dawn.com account,

c)using cdo when customer select "employment opportunities" option then i receive customer info in to jobs@dawn.com account,

d)using cdo when customer select "web development" option then i receive customer info in to web@dawn.com account,

i think for this purpose i need condition .
but i dont know how i can solve it using cdo
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 131
Reputation: william_stam is an unknown quantity at this point 
Solved Threads: 2
william_stam's Avatar
william_stam william_stam is offline Offline
Junior Poster

Re: cdo using combo box in my form

 
0
  #4
Dec 29th, 2005
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
  2. <% If request.Form("emailtoad")<>"" Then %>
  3. <%
  4.  
  5. ' Send by connecting to port 25 of the SMTP server.
  6. Dim iMsg
  7. Dim iConf
  8. Dim Flds
  9. Dim strHTML
  10. Dim mailserver
  11.  
  12. mailserver = "mail server" ' enter a valid mail server
  13.  
  14. Const cdoSendUsingPort = 2
  15.  
  16. set iMsg = CreateObject("CDO.Message")
  17. set iConf = CreateObject("CDO.Configuration")
  18.  
  19. Set Flds = iConf.Fields
  20.  
  21. ' Set the CDOSYS configuration fields to use port 25 on the SMTP server.
  22.  
  23. With Flds
  24. .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
  25. .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = mailserver
  26. .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
  27. .Update
  28. End With
  29.  
  30. ' Apply the settings to the message.
  31. With iMsg
  32. Set .Configuration = iConf
  33. .To = Request.Form("email")
  34. .From = "something@something.com"
  35. .Subject = "Subject Goes here"
  36. .HTMLBody = "this is the mails body"
  37. .Send
  38. End With
  39.  
  40. ' Clean up variables.
  41. Set iMsg = Nothing
  42. Set iConf = Nothing
  43. Set Flds = Nothing
  44.  
  45. %>
  46. <% End If %>
  47. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  48. <html>
  49. <head>
  50. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  51. <title>Test</title>
  52. </head>
  53.  
  54. <body>
  55. <form name="form1" method="post" action="">
  56. <select name="emailtoad">
  57. <option selected>Please select a category</option>
  58. <option value="sales@dawn.com">Sales</option>
  59. <option value="support@dawn.com">Technical Support</option>
  60. <option value="jobs@dawn.com">Employment Opportunities</option>
  61. <option value="web@dawn.com">Web development</option>
  62. </select>
  63. <input type="submit" name="Submit" value="Submit">
  64. </form>
  65. </body>
  66. </html>


you will just have to put your other form fields in, im too lazy at the moment to do so.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC