谁能帮我修改下ASP代码,改为用JMAIL发送邮件,并同时写入数据库。
发布网友
发布时间:2022-04-15 08:28
我来回答
共1个回答
热心网友
时间:2022-04-15 09:57
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../conn/conn.asp" -->
<%
question_1=request("question_1") 'How did you find out about the Bunnings Warehouse Website?
question_2=request("question_2") 'Overall how would you rate – Content?
question_3=request("question_3") 'Overall how would you rate – Ease of Use?
question_4=request("question_4") 'Overall how would you rate – Speed?
question_5=request("question_5") 'What pages have you visited?
question_6=request("question_6") 'How often do you visit our website?
question_7=request("question_7") 'What additional information would you like to see on our site?
question_8=request("question_8") 'Age
question_9=request("question_9") 'Gender
question_10=request("question_10") 'Location
question_11=request("question_11") 'Comments
mailinfo="How did you find out about the Bunnings Warehouse Website?<br>"+question_1+"<br><br>Overall how would you rate – Content?<br>"+question_2+"<br><br>Overall how would you rate – Ease of Use?<br>"+question_3+"<br><br>Overall how would you rate – Speed?<br>"+question_4+"<br><br>What pages have you visited?<br>"+question_5+"<br><br>How often do you visit our website?<br>"+question_6+"<br><br>What additional information would you like to see on our site?<br>"+question_7+"<br><br>Age<br>"+question_8+"<br><br>Gender<br>"+question_9+"<br><br>Location<br>"+question_10+"<br><br>Comments<br>"+question_11+"<br><br>"
ip_13=Request.ServerVariables("REMOTE_ADDR") 'ip
set rs=server.CreateObject("adodb.recordset")
sql="select * from feedback"
rs.open sql,conn,1,3
rs.addnew
rs("question_1")=question_1 'How did you find out about the Bunnings Warehouse Website?
rs("question_2")=question_2 'Overall how would you rate – Content?
rs("question_3")=question_3 'Overall how would you rate – Ease of Use?
rs("question_4")=question_4 'Overall how would you rate – Speed?
rs("question_5")=question_5 'What pages have you visited?
rs("question_6")=question_6 'How often do you visit our website?
rs("question_7")=question_7 'What additional information would you like to see on our site?
rs("question_8")=question_8 'Age
rs("question_9")=question_9 'Gender
rs("question_10")=question_10 'Location
rs("question_11")=question_11 'Comments
rs("ip_13")=ip_13 'ip
rs.update
rs.close
conn.close
'Jmail代码
Email="收件人邮箱地址"
Set jmail = Server.CreateObject("JMAIL.Message") '建立发送邮件的对象
jmail.silent = true '屏蔽例外错误,返回FALSE跟TRUE两值j
'mail.logging = true '启用邮件日志
jmail.Charset = "GB2312" '邮件的文字编码为国标
jmail.ContentType = "text/html" '邮件的格式为HTML格式
jmail.AddRecipient Email '邮件收件人的地址
jmail.From = "panshuwen010@126.com" '发件人的E-MAIL地址
jmail.MailServerUserName = "panshuwen010" '登录邮件服务器所需的用户名
jmail.MailServerPassword = "******" '登录邮件服务器所需的密码
jmail.Subject = fromname&"发送给你的邮件" '邮件的标题
jmail.Body = mailinfo '邮件的内容
'jmail.Prority = 1 '邮件的紧急程序,1 为最快,5 为最慢, 3 为默认值
jmail.Send("Server Address") '执行邮件发送(通过邮件服务器地址)
jmail.Close() '关闭对象
Response.Write "<Script Language=JavaScript>alert('Sent successful!Thanks!');window.close();</Script>"
%>