主题:  如何在反馈单上再加上同时发送邮件的功能?

guyang

职务:普通成员
等级:1
金币:0.0
发贴:34
#12003/5/3 20:50:38
这是提交反馈单同时发送邮件的代码:
    
    '-----------------------------------------------------
ON ERROR RESUME NEXT
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.Charset = "gb2312"
JMail.ServerAddress =""
JMail.Priority = 1
JMail.Sender = (guyang0@163.com)
JMail.Subject ="腾风反馈客户业务资料"
JMail.SenderName = (name)
JMail.ReplyTo = (腾风网络)
JMail.AddRecipient(info@tengfeng.com)


mess = "------------------------------------------------" & vbcrlf
mess = mess & name & " 你好!" & vbcrlf
mess = mess & " 收到客户的反馈资料!" & vbcrlf
mess = mess & " 姓名:" &name & vbcrlf
mess = mess & " 公司:" &title& vbcrlf
mess = mess & " 电话: " & homepage& vbcrlf
mess = mess & " 地址:" & mail & vbcrlf
mess = mess & " 邮箱:" & address & vbcrlf
mess = mess & " 项目:" & Goods & vbcrlf
mess = mess & " 留言:" & guest & vbcrlf
mess = mess &"" & vbcrlf
mess = mess & " 程序制做:腾风网络. www.tengfeng.com" & vbcrlf
mess = mess & vbcrlf
mess = mess & "------------------------------------------------"
JMail.Body = mess
JMail.Execute()
JMail.Close()
set jMail=nothing

'-----------------------------------------------------------

以下是提交反馈单处理保存的页面代码:
<%@LANGUAGE="VBSCRIPT"%>







<%
rem -----------------------
rem ---显示留言成功函数----
rem -----------------------
function guestAccussful
if Goods=1 then
    response.write "留言成功!
"
    response.write "
你只是在本站留了言,没有订货.
"
else
    response.write "
你订购是"&chooseGoods(Goods-1)
    response.write "
订货成功!请等待本站的回复.
"
end if
if len(title)>0 then
    response.write "
公司:"&server.htmlencode(replace(title,"''","'"))&""
end if
if len(guest)>0 then
guest=replace(guest,"<","<")
guest=replace(guest,">",">")
guest=replace(guest,chr(34),""")
    response.write "
留言:
"&replace(guest,"''","'")&"
"
end if
if len(name)>0 then
    response.write "
您的姓名:"&server.htmlencode(replace(name,"''","'"))
end if
if len(homepage)>0 then
    response.write "
您的电话:"&server.htmlencode(replace(homepage,"''","'"))&""
end if
if len(mail)>0 then
    response.write "
您是地址:"&server.htmlencode(replace(mail,"''","'"))&""
end if
if len(address)>0 then
    response.write "
电子邮箱:"&server.htmlencode(replace(address,"''","'"))
end if

response.write "
时间:"&ndatetime
end function

rem -----------------------
rem ---显示成功函数结束----
rem -----------------------

name=request("name")
if len(name)>50 then
response.write "你的名字这么长呀?我记不住啦!!"
response.end
end if

title=request("title")
if len(title)>200 then
response.write "你的主题好长呀?我撑不下了!!"
response.end
end if

if title="" then
response.write "错误!你要为提供您的公司地址才对呀!!"
response.end
end if

homepage=request("homepage")
if len(homepage)>400 then
response.write "你的主页太长了,填不下了!!申请个二级域名之类的吧!!"
response.end
end if

Goods=request("Goods")
if isNumeric(Goods)>=0 then
Goods=0
else
Goods=Cint(Goods)
end if
if Goods<1 or Goods>chooseNum then Goods=1

mail=request("mail")
if len(mail)>100 then
response.write "你的邮箱地址太长了,填不下了!!"
response.end
end if

address=request("address")
if len(address)>200 then
response.write "你的地址太长了,填不下了!!"
response.end
end if

guest=request("guest")
if len(address)>3200 then
response.write "你的留言内容太长了,截掉一些内容或分成多次留言吧!"
response.end
end if
%>

<%
ndatetime=now()
if name<>"" then name=replace(name,"'","''")
if title<>"" then title=replace(title,"'","''")
if homepage<>"" then homepage=replace(homepage,"'","''")
if mail<>"" then mail=replace(mail,"'","''")
if address<>"" then address=replace(address,"'","''")
if guest<>"" then guest=replace(guest,"'","''")
con.Execute " INSERT INTO guest " _
& "(guesttime,name,title,homepage,product,mail,address,guest) valueS " _
    & "('"&ndatetime&"', '" & name &"','" & title & "','"& homepage &"'," & Goods &",'" & mail &"','" & address &"','" & guest &"');"
con.close
set con=nothing
guestAccussful()
%>

返回



我如何把这两个代码整合起来运用呢?请高手指教!



Anjet

职务:普通成员
等级:1
金币:0.0
发贴:19
#22003/5/4 0:52:41
先把前面的mail发送设置一个sub,然后在后面的保存信息之后调用。



{ 在指尖上绽放的花朵 }

职务:普通成员
等级:5
金币:14.0
发贴:3209
#32003/5/6 10:40:13
服务器需要Jmail 组件支持的说……



小义zfy520

职务:普通成员
等级:3
金币:2.0
发贴:965
#42003/5/8 20:25:29
我也想知道



流枫

职务:普通成员
等级:2
金币:0.0
发贴:466
#52003/5/8 21:27:19
我想
要是我的话
我就往里面加入一个ASP
发送邮件的源码!


黑龙江求职网-站长
www.hr63.com