mailserver="smtp.ood1.com" '(修改smtp服务器地址)
username="good-1@ood1.com" '(用来做发送邮件的地址)
password="ood1.com" ' (做发送邮件密码)
receive="ood1.com@139.com" '接受反馈信息的email地址(用来接收留言的邮箱)
修改成您自己的邮箱就行.
----------------------------------------------------------------------
<%response.charset="gb2312"%>
<HTML>
<BODY>
<form action="sent.asp?go=sent" method="post">
<table>
用户名:<input type="text" name="name" id="name" value="">
邮箱:<input type="text" name="email" id="email" value="***@msn.com">
主题:<input type="text" name="subject" id="subject" value="Jmail中文邮件发送测试" >
反馈信息:<td width="650">
<TEXTAREA NAME="content" ROWS="5" COLS="50"></TEXTAREA>
<td colspan="2" align="center"><INPUT TYPE="submit" value="提交">
</table>
</form>
<%
If request("go")<>"sent" Then response.End
dim CLStr,msg,mailserver,username,password,receive
CLStr=Chr(13) & Chr(10)
'请在此修改相关信息
mailserver="smtp.ood1.com" '邮局服务器地址(smtp服务器地址)
username="****@ood1.com" 'smtp服务器验证登陆名(用来做为代发邮件的地址)
password="ood1.com" 'smtp服务器验证密码 (信箱密码)
receive="ood1.com@139.com" '接受反馈信息的email地址(用来接收邮件的信箱)
'修改结束
Set msg = Server.CreateObject("JMail.Message")
msg.Charset = "gb2312"
msg.logging = true '启用邮件日志
msg.silent=True'屏蔽例外错误,返回False或True
'msg.ContentType = "text/html"'邮件的格式为HTML格式
msg.Priority = 1 '邮件等级,1为加急,3为普通,5为低级
msg.MailServerUserName = username
msg.MailServerPassword = password
msg.From = username
msg.FromName = username
msg.AddRecipient (receive)
msg.Subject = "网站在线反馈:"&Request.Form("subject")
msg.HTMLBody = "网站在线反馈"&CLStr&CLStr
msg.HTMLBody = msg.HTMLBody&"<br>对方姓名:"&Request.Form("name")&CLStr
msg.HTMLBody = msg.HTMLBody&"<br>对方信箱:"&Request.Form("email")&CLStr
msg.HTMLBody = msg.HTMLBody&"<br>留言内容:<br>"
msg.HTMLBody = msg.HTMLBody&"<div style='font:9pt;background-color:#eeeeee'>"&Request.Form("content")&CLStr
msg.HTMLBody = msg.HTMLBody&""
If msg.Send (mailserver) Then
Response.Write(" <script language=javascript>alert('发送成功');location='sent.asp'</script>")
else
Response.Write(" <script language=javascript>alert('发送失败,请仔细检查邮件服务器的设置是否正确!') </script>")
End If
msg.close
set msg = nothing
%>
<p>邮件发送成功,谢谢使用</p>
</BODY>
</HTML>