I need to send the results of some selected answers to email... how can I do this?
Printable View
I need to send the results of some selected answers to email... how can I do this?
There are two ways that I know of:
1. Send the form data using a simple "mailto:[email protected]" in the FORM tag (<FORM NAME="FeedbackForm" METHOD="POST" ACTION="mailto:[email protected]"> THe major problem with this is that the user must have a email client installed on their desktop (like outlook). Plus, the formatting isn't very pretty.
2. If you have the ability to use ASP in your web site, you can use CDO for NTS (Common Data Objects for NT Server). Something like this:
<FORM NAME="FeedbackForm" METHOD="POST" ACTION="SendMail.asp">
then in the file SendMail.asp :
<%@ LANGUAGE="VBScript"%>
<%
dim strSendTo, strSender, strBody, strSubj
strSendTo = Request.Form("SendTo")
strSender = Request.Form("Sender")
strBody = Request.Form("EmailBody")
strSubj = Request.Form("Subject")
if strSendTo = "" then
strSendTo = "[email protected]"
end if
if strSender = "" then
strSender = "[email protected]")
end if
Set objMail = Server.CreateObject("CDONTS.NewMail")
with objMail
.To = strSendTo
.From = strSender
.Body = strBody
.Subject = strSubj
.Send
end with
Set objMail = Nothing
%>
if you do a search through this forum for 'send mail' you will probably get better answers than this. ;)