|
-
July 17th, 2002, 10:37 AM
#1
html forum submit to email
I need to send the results of some selected answers to email... how can I do this?
-
July 18th, 2002, 01:41 PM
#2
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|