| | |
cdo using combo box in my form
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Dec 2004
Posts: 27
Reputation:
Solved Threads: 0
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.
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.
<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 %>
<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 %>
•
•
Join Date: Dec 2004
Posts: 27
Reputation:
Solved Threads: 0
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
<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
ASP Syntax (Toggle Plain Text)
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% If request.Form("emailtoad")<>"" Then %> <% ' Send by connecting to port 25 of the SMTP server. Dim iMsg Dim iConf Dim Flds Dim strHTML Dim mailserver mailserver = "mail server" ' enter a valid mail server Const cdoSendUsingPort = 2 set iMsg = CreateObject("CDO.Message") set iConf = CreateObject("CDO.Configuration") Set Flds = iConf.Fields ' Set the CDOSYS configuration fields to use port 25 on the SMTP server. With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = mailserver .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10 .Update End With ' Apply the settings to the message. With iMsg Set .Configuration = iConf .To = Request.Form("email") .From = "something@something.com" .Subject = "Subject Goes here" .HTMLBody = "this is the mails body" .Send End With ' Clean up variables. Set iMsg = Nothing Set iConf = Nothing Set Flds = Nothing %> <% End If %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Test</title> </head> <body> <form name="form1" method="post" action=""> <select name="emailtoad"> <option selected>Please select a category</option> <option value="sales@dawn.com">Sales</option> <option value="support@dawn.com">Technical Support</option> <option value="jobs@dawn.com">Employment Opportunities</option> <option value="web@dawn.com">Web development</option> </select> <input type="submit" name="Submit" value="Submit"> </form> </body> </html>
you will just have to put your other form fields in, im too lazy at the moment to do so.
![]() |
Similar Threads
- Multi column combo box (VB.NET)
- Combo box and Ms-access (JSP)
- combo box (PHP)
- combo box (ASP)
- combo box help (VB.NET)
Other Threads in the ASP Forum
- Previous Thread: mysqldump from asp
- Next Thread: Help with asp form will not display contact information
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7





