附件:sendmail.asp

发表于:2007-06-30来源:作者:点击数: 标签:
!-- This sample script uses the CDO for NTS Library to send email to a specific user. Leon Braginski nbsp;Note: To is a reserved word, so we added an underscore to it. -- %@ LANGUAGE = VB Script % % If (Request.ServerVariables (REQUEST_METH
<!--
    This sample script uses the CDO for NTS Library to
    send email to a specific user.
    Leon Braginski & Matt Powell (c)
    Note: "To" is a reserved word, so we added an underscore to it.
-->

<%@ LANGUAGE = "VBScript" %>

<%
If (Request.ServerVariables ("REQUEST_METHOD") = "POST") then
    From = Request.Form("from")
    To_ = Request.Form("to")
    Subject = Request.Form("subject")
    Body = Request.Form("body")
else
    @# Assume it is GET
    From = Request.QueryString("from")
    To_ = Request.QueryString("to")
    Subject = Request.QueryString("subject")
    Body = Request.QueryString("body")
end if

Set objNewMail = Server.CreateObject ("CDONTS.NewMail")
objNewMail.Send From, To_, Subject, Body
Set objNewMail = Nothing
Response.Write "Message was sent"
%>

原文转自:http://www.ltesting.net