Jmail 发送邮件的例子1

Mr.zhuMr.zhu2025-08-16 00:30:17来源:微信视频号 (github.com/ltaoo/wx_channels_download)阅读:56

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">


<%if request("action")="send" then%>
<%

'参数说明
'Subject : 邮件标题
'MailAddress : 发件服务器的地址,如smtp.163.com
'Email : 收件人邮件地址
'Sender : 发件人姓名
'Content : 邮件内容
'Fromer : 发件人的邮件地址

Sub SendAction(subject, email, sender, content)
 Set JMail = Server.CreateObject("JMail.Message")
 JMail.Charset = "gb2312" ' 邮件字符集,默认为"US-ASCII"
 JMail.From = strMailUser ' 发送者地址
 JMail.FromName = sender' 发送者姓名
 JMail.Subject =subject
 JMail.MailServerUserName = strMailUser' 身份验证的用户名
 JMail.MailServerPassword = strMailPass ' 身份验证的密码
 JMail.Priority = 3
 JMail.AddRecipient(email)
 JMail.Body = content
 JMail.Send(strMailAddress)
End Sub

'调用此Sub的例子
Dim strSubject,strEmail,strMailAdress,strSender,strContent,strFromer
strSubject = Request("title")
strContent = "用户Email:" & Request("From") & VbCrLf & "电话:" & Request("Tel") & VbCrLf & "内容:" & vbcrlf & Request("content")
strSender  = Request("Name")
strEmail = "anybody@163.com" '这是收信的地址,可以改为其它的邮箱
strMailAddress = "mail.yourdomain.com" '我司企业邮局地址,请使用 mail.您的域名
strMailUser  = "user@yourdomain.com" '我司企业邮局用户名
strMailPass  = "mailpassword" '邮局用户密码

Call SendAction (strSubject,strEmail,strSender,strContent)

%>

<script language="javascript">
alert('恭喜您,发送成功!');
history.back();
</script>


<%else%>
<style type="text/css">
<!--body { margin-top: 0px;margin-bottom: 0px;}td {
 font-size: 12px;
 text-decoration: none;}--></style>
<table width="500" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#666666">
<tr><td height="40" bgcolor="#E3E3E3"><div align="center">发邮件给我们</div></td></tr>
<tr><td background="images/formmail_r2_c1.gif"><table width="100%" height="296" border="0" align="center" cellpadding="1" cellspacing="1">
<form name="form" method="post" action="?action=send">
<tr bgcolor="#FFFFFF">
<td width="110" align="center"><div align="left">邮件主题(title)*</div></td>
<td width="288"><input name="title" type="text" id="title" size="22">
姓名(name)
<input name="name" type="text" id="name" size="8">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center"><div align="left">你的邮箱(mailaddress)*</div></td>
<td><input name="from" type="text" id="from" size="22">
电话(tel)
<input name="tel" type="text" id="tel" size="15"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="213" align="center"><div align="left">内容(content):*<br>
</div></td>
<td><textarea name="content" cols="50" rows="15"></textarea></td>
</tr>
<tr bgcolor="#FFFFFF">
<td> </td>
<td> <input type="submit" name="Submit" value="提交"></td></tr></form></table></td>
</tr></table>
<%end if%>

猜你想看

什么是应届生?应届生的身份有多重要?别等到毕业才知道
为什么不提倡个人缴纳社保,5点原因要注意,关系到你的钱袋子
猪肉在冰箱里能放多久?专家:若超过这个时间,还是扔掉吧!
强奸罪及其量刑标准
“一成首付买车”,您真的看懂了吗?
新能源电池迎来无钴时代,物美价廉锰元素或可取代,关注2概念股
盘点海南各市县经典小吃,本地人都不一定全知道!
八达岭长城开启“夜游长城”旅游项目
“安全套”上的油是什么?会对女性身体造成伤害吗?看完涨知识了
“中国四大名酒”是哪些?你认识几种?原来白酒也有地位之分
帮你的人,不欠你;让你的人,不怕你
全国高速将统一限速!这些行为不再扣分罚款!
最全的汽车轮胎知识,看完可以转行卖轮胎了!
豆腐的下脚料,铁、钙、蛋白一样不少!可大家往往都不知道怎么吃
努力2年转行,自由职业一年多,说说我对自由职业的总结
人参、红参、沙参、党参、西洋参、高丽参各有什么不同
为何跑车很少上高速?法拉利车主甩出钥匙:试试就知道了
养老保险全国统一!以后在哪交社保,领钱都一样吗?
怎样开车才能提速快?老司机:别傻乎乎只踩油门
官宣!大宝贝刘禹彤加盟山西女篮 征战WCBA联赛

推荐站点