CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2001
    Location
    New Jersey
    Posts
    312

    html forum submit to email

    I need to send the results of some selected answers to email... how can I do this?

  2. #2
    Join Date
    Apr 2001
    Location
    Salt Lake City, UT
    Posts
    135
    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
  •  





Click Here to Expand Forum to Full Width

Featured