jmail组件asp代码下载:下载地址一
<html><head><title>好的科技--24小时服务中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="contact/tab_menu.css" type=text/css rel=stylesheet>
</head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">
<script>
function check(f) {
if (f.name.value == '') { alert('请输入姓名!'); f.name.focus(); return false; }
if (f.tel.value == '') { alert('请输入电话!'); f.tel.focus(); return false; }
}
</script>
<form action="1.asp?go=sent" method="post" onsubmit="return check(this)">
<table>
<tr><td>姓名:</td><td><input name="name" type="text" id="name" value="" maxlength="5"></td></tr>
<tr><td>邮箱:</td><td><input type="text" name="email" id="email"></td></tr>
<tr><td>电话:</td><td><input name="tel" type="text" id="tel" maxlength="15" ></td></tr>
<tr><td>Q Q:</td><td><input type="text" name="qq" id="qq" ></td></tr>
<tr><td>是否需要邮件回复</td>
<td><p>
<label>
<input name="yjhf" type="radio" id="yjhf_0" value="需要">
需要</label>
<label>
<input type="radio" name="yjhf" value="不需要" id="yjhf_1">
不需要</label>
<br>
</p></td>
</tr>
<tr><td>反馈信息:</td><td width="650"><textarea name="content" rows="5" cols="50"></textarea></td>
</tr>
<tr><td colspan="2" align="center"><INPUT name="button" TYPE="submit" id="button" value="提交留言"></td></tr>
</table>
</form>
<%
If request("go")<>"sent" Then response.End
dim CLStr,msg,mailserver,username,password,receive
CLStr=Chr(13) & Chr(10)
mailserver="smtp.163.com"
username="你的邮箱@163.com"
password="邮箱密码"
receive="接收邮件的邮箱@163.com,想要有短信或微信提醒功能,就注册个手机邮箱.里面可以设置短信或微信提醒功能"
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("name") &Request.Form("tel") &Request.Form("email") &Request.Form("content")
msg.HTMLBody = msg.HTMLBody&"<br>主题:"&Request.Form("content")&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('提交成功!我们会在15分钟内把结果发送到您手机上!');history.go(-1)</script>")
else
Response.Write(" <script language=javascript>alert('发送失败,请再次发送或联系客服订购!') </script>")
End If
msg.close
set msg = nothing
%>
<p>发送成功,谢谢使用</p></td>
</div>
</body>
</html>