日期:2014-05-17  浏览次数:20858 次

hTML的form我想转发后通过asp程序处理后直接发到email里边 怎么实现 着急~~高手帮忙
hTML的form我想转发后通过asp程序处理后直接发到email里边 怎么实现   着急~~高手帮忙

最好有例子   马上节分

------解决方案--------------------
<form id= "form1 " name= "form1 " method= "post " action= "aa.asp ">
<input name= "aa " type= "text " id= "aa " />
<input type= "submit " name= "Submit " value= "提交 " />
</form>


aa.asp里的代码
<%
dim strContent
strContent = request( "aa ")

set jmail = server.CreateObject ( "jmail.message ") ' '创建对象
jmail.Silent = true ' '一般不用改
jmail.Charset = "gb2312 " ' '信件的语言编码
jmail.ContentType = "text/html " ' '信件的格式html或纯文本
jmail.From = webEmail ' '发信人邮箱
jmail.FromName = webName ' '发信人姓名
jmail.Subject = emailTitle ' '信件主题
jmail.AddRecipient inceptEmailAdd ' '收信人地址
jmail.Body = strContent ' '信件正文
jmail.MailServerUserName = webEmailUserName ' '服务器登陆用户名(您的邮件地址)
jmail.MailServerPassWord = webEmailUserPWD ' '服务器登陆密码(您的邮件密码)
jmail.Send(webSmtp) ' '服务器地址
jmail.Close
set jmail = nothing
%>

前提是服务器上要安装 jmail组件
------解决方案--------------------
strSubject = "来自: " & Request.Servervariables( "REMOTE_HOST ") & "的客户于 " & now() & "提交订单! "
strContents = "来自: " & Request.Servervariables( "REMOTE_HOST ") & "的客户于 " & now() & "提交了以下订单! <br> "
strContents = strContents & "产品名称: " & request( "namef ") & " <br> 规格型号: " & request( "guigef ") & " <br> 订货数量: " & request( "numf ") & " <br> 订货方公司名: " & request( "companyf ") & " <br> 订货方联系人: " & request( "peoplef ") & " <br> 联系地址: " & request( "addressf ") & " <br> 邮 编: " & request( "postnof ") & " <br> 电 话: " & request( "faxf ") & " <br> 传 真: " & request( "telf ") & " <br> 电子邮箱: " & request( "emailf ") & " <br> 其他要求: " & request( "infof ") & " "
if sendmail( "sales@abc.com ", "sales@abc.com ",strSubject,strContents) <> true then
response.write "订单系统发生错误,请致电至我公司市场部! "
response.end
end if
Function sendmail(ByVal mailFrom, mailto, mailsubject, mailbody) ' 邮件发送(CDONTS)
Dim myMail
Set myMail = server.CreateObject( "CDONTS.NewMail ")
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.from = mailFrom
myMail.To = mailto
myMail.CC = mailCC
myMail.subject = mailsubject
myMail.Body = mailbody
myMail.send
Set myMail = Nothing
sendmail = true
End Function