|
Hello all,
I am a beginner at ASP and I recently built a simple form mail. It worked fine, but now I want to make it a little more complicated. Instead of a user filling out the form and sending it off, I want them to use a menu list to select who they want to contact. Then they could fill out the form and when they press send it will go to the appropriate party.
Here is the script:
<%
Set JMail = Server.CreateObject("JMail.Message")
JMail.ISOEncodeHeaders = False
JMail.From = Request.Form("Email")
JMail.Subject = "Thank you...."
JMail.AddRecipient "someone@somedomain.com"
JMail.Priority = 1
JMail.Send("mail.somedomain.com")
%>
So you can see it is very simple. I have added the menu list and assigned values to all the recipients. I just dont know how to tie it in with the script.
Any help appreciated.
|
|
|
You know how to code the mail script. You know how to create an HTML form that prompts for an email address. You know how to pass that "Email" value to the mail script. Seems like you'd know how to pass a Recipient value to the script. In any case, just modify your mail code like this:
<%
Set JMail = Server.CreateObject("JMail.Message")
JMail.ISOEncodeHeaders = False
JMail.From = Request.Form("Email")
JMail.Subject = "Thank you...."
Recipient = Request.Form("Recipient")
JMail.AddRecipient Recipient
JMail.Priority = 1
JMail.Send("mail.somedomain.com")
%>
|
|
Then add a Recipient dropdown to your HTML form like this:
<select name="Recipient">
<option value="troy@shinysolutions.com">Troy Wolf</option>
<option value="david@codetoad.com">David Bruce</option>
<option value="bob@aol.com">Bob Smith</option>
</select>
|
|
|
|
|
|
|
Thanks Troy, Im learning all this one step at a time. I appreciate your help.
|
|
|
|
|
|
|
|