I already have a working form that sends and email based on drop down selection. Now I need to add a field that the user types an email in and it Cc's the form to that manually typed email.
I found a site that seemed to explain it but I can't get it to work.
Here is the drop down selection in the form:
---CODE---
<select name="recipient" size="1">
<option value="0" selected></option>
<option value="1">Tim Hynes - St. Louis</option>
<option value="2">Tina Funkhouser - Huntsville</option>
<option value="3">Robin Elliott - Huntsville</option>
<option value="4">Diane Bergman - Manassas</option>
<option value="5">Karen O'Connor - NCR</option>
<option value="6">Charlie Douglas - SimAuthor</option>
</select>
---ENDCODE---
Here is the send.asp form:
---CODE---
<%@ Language=VBScript %>
<%
Dim objMail
Dim crlf
Dim strBody
crlf = Chr(10) & Chr(13)
Set objMail = CreateObject("CDONTS.NewMail")
objMail.From = "WestarVisitRequest"
Names = Array("","hynes@westar.com","funkhouser@westar.com","elliott@westar.com","bergman@westar.com","oconnor@westar.com","cdouglas@simauthor.com")
name = Names( CLng( Request("recipient") ) )
IF name = "" Then
Response.Write "EMail to nobody?"
Response.End
End If
objmail.to = name
objMail.Subject= Request.Form("Westar Visit Request Form")
strBody = "Name: " & Request.Form("name") & crlf
strBody = strBody & "Contract Number: " & Request.Form("contractnum") & crlf
strBody = strBody & "Government POC " & Request.Form("govpoc") & crlf
strBody = strBody & "Government POC Fax: " & Request.Form("govpocfax") & crlf
strBody = strBody & "Government POC Phone: " & Request.Form("govpocphone") & crlf
strBody = strBody & "Company Name: " & Request.Form("coname") & crlf
strBody = strBody & "Address: " & Request.Form("address") & crlf
strBody = strBody & "City: " & Request.Form("city") & crlf
strBody = strBody & "State: " & Request.Form("state") & crlf
strBody = strBody & "Zip: " & Request.Form("zip") & crlf
strBody = strBody & "Fax: " & Request.Form("fax") & crlf
strBody = strBody & "Phone: " & Request.Form("phone") & crlf
strBody = strBody & "Technical POC: " & Request.Form("techpoc") & crlf
strBody = strBody & "Technical POC Phone Number: " & Request.Form("techphone") & crlf
strBody = strBody & "Purpose of Visit: " & Request.Form("purpose") & crlf
strBody = strBody & "Duration of Visit: " & Request.Form("duration") & crlf
strBody = strBody & "Additional Comments: " & Request.Form("comments") & crlf
strBody = strBody & "Cc to: " & Request.Form("cc") & crlf
strBody = strBody & "Cc to: " & Request.Form("cc2") & crlf
objMail.Body= strBody
objMail.Send
Set objMail = Nothing
Response.Write "Message sent. Redirecting to confirmation page."
Response.Redirect "%>
---ENDCODE---
I found a site that seemed to explain it but I can't get it to work.
Here is the drop down selection in the form:
---CODE---
<select name="recipient" size="1">
<option value="0" selected></option>
<option value="1">Tim Hynes - St. Louis</option>
<option value="2">Tina Funkhouser - Huntsville</option>
<option value="3">Robin Elliott - Huntsville</option>
<option value="4">Diane Bergman - Manassas</option>
<option value="5">Karen O'Connor - NCR</option>
<option value="6">Charlie Douglas - SimAuthor</option>
</select>
---ENDCODE---
Here is the send.asp form:
---CODE---
<%@ Language=VBScript %>
<%
Dim objMail
Dim crlf
Dim strBody
crlf = Chr(10) & Chr(13)
Set objMail = CreateObject("CDONTS.NewMail")
objMail.From = "WestarVisitRequest"
Names = Array("","hynes@westar.com","funkhouser@westar.com","elliott@westar.com","bergman@westar.com","oconnor@westar.com","cdouglas@simauthor.com")
name = Names( CLng( Request("recipient") ) )
IF name = "" Then
Response.Write "EMail to nobody?"
Response.End
End If
objmail.to = name
objMail.Subject= Request.Form("Westar Visit Request Form")
strBody = "Name: " & Request.Form("name") & crlf
strBody = strBody & "Contract Number: " & Request.Form("contractnum") & crlf
strBody = strBody & "Government POC " & Request.Form("govpoc") & crlf
strBody = strBody & "Government POC Fax: " & Request.Form("govpocfax") & crlf
strBody = strBody & "Government POC Phone: " & Request.Form("govpocphone") & crlf
strBody = strBody & "Company Name: " & Request.Form("coname") & crlf
strBody = strBody & "Address: " & Request.Form("address") & crlf
strBody = strBody & "City: " & Request.Form("city") & crlf
strBody = strBody & "State: " & Request.Form("state") & crlf
strBody = strBody & "Zip: " & Request.Form("zip") & crlf
strBody = strBody & "Fax: " & Request.Form("fax") & crlf
strBody = strBody & "Phone: " & Request.Form("phone") & crlf
strBody = strBody & "Technical POC: " & Request.Form("techpoc") & crlf
strBody = strBody & "Technical POC Phone Number: " & Request.Form("techphone") & crlf
strBody = strBody & "Purpose of Visit: " & Request.Form("purpose") & crlf
strBody = strBody & "Duration of Visit: " & Request.Form("duration") & crlf
strBody = strBody & "Additional Comments: " & Request.Form("comments") & crlf
strBody = strBody & "Cc to: " & Request.Form("cc") & crlf
strBody = strBody & "Cc to: " & Request.Form("cc2") & crlf
objMail.Body= strBody
objMail.Send
Set objMail = Nothing
Response.Write "Message sent. Redirecting to confirmation page."
Response.Redirect "%>
---ENDCODE---