Form - sending to different e-mail address when option is selected

Joined
Nov 12, 2007
Messages
1
Reaction score
0
Hello,

I've got a form set up which sends an e-mail to a specific e-mail address.

I would like to be able to select from a drop down menu or similar to choose which e-mail address the form gets sent to.

This is what I have got currently.

<%

Dim arrReceivedData(110)
Dim arrError(110)

i=0

response.write request.form("name")

strmessage = "Name: " & request.form("Name") & vbcrlf & vbcrlf & "Issue:" & vbcrlf & request.form("Issue")

set objMail = Server.CreateObject("CDO.Message")
' CDONTS -> CDOSYS migration - disabled: objMail.MailFormat = 0

objMail.From = "e-mail address"
objMail.To = "e-mail address"
objMail.Fields("urn:schemas:mailheader: x-mailer") = ""
objMail.Subject = "Subject of e-mail"
objMail.TextBody = strMessage
objMail.Fields("urn:schemas:mailheader: priority") = 0
objMail.Send

set objMail = Nothing

%>


I've tried this but it doesn't work-

<%

Dim arrReceivedData(110)
Dim arrError(110)

i=0

response.write request.form("name")

strmessage = "Name: " & request.form("Name") & vbcrlf & vbcrlf & "Issue:" & vbcrlf & request.form("Issue")

set objMail = Server.CreateObject("CDO.Message")
' CDONTS -> CDOSYS migration - disabled: objMail.MailFormat = 0

objMail.From = "e-mail address"
objMail.To = request.form("option")
objMail.Fields("urn:schemas:mailheader: x-mailer") = ""
objMail.Subject = "Subject of e-mail"
objMail.TextBody = strMessage
objMail.Fields("urn:schemas:mailheader: priority") = 0
objMail.Send

set objMail = Nothing

%>


Can anyone help??

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top