⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 user_sendmail.asp

📁 电影ASP文件
💻 ASP
字号:
<!--#include file="../film_conn.asp"-->
<!--#include file="session.asp"-->
<!--#include file="../set_url.asp"-->
<%
if session("flag")>1 then
response.write "<br><p align=center>您的操作权限不够!</p>"
response.end
end if
%>
<%
if request("action") = "send" then
frommail = Trim(Request.Form("frommail"))
tomail = Trim(Request.Form("tomail"))
mailsubject = Trim(Request.Form("mailsubject"))
mailbody = Trim(Request.Form("mailbody"))
	
if tomail<>"" then
Set JMail= Server.CreateObject("JMail.SMTPMail")
JMail.Charset ="gb2312"
JMail.ContentType = "text/html"
JMail.Sender= frommail
JMail.AddRecipient(""&tomail&"")
JMail.Subject = mailsubject  
JMail.Body = mailbody
JMail.Priority = 3   
JMail.Execute
Set JMail= Nothing
else
Set JMail= Server.CreateObject("JMail.SMTPMail")
JMail.Charset ="gb2312"
JMail.ContentType = "text/html"
JMail.Sender = frommail
sql="select email from users"
set rs=conn.execute(sql)
Response.Write("正在邮件群发.................." )
do while not rs.eof 
JMail.AddRecipient(""&rs("email")&"")
RS.MoveNext
Loop
rs.close
JMail.Subject = mailsubject  
JMail.Body = mailbody
JMail.Priority = 3   
JMail.Execute
Set JMail= Nothing
end if
Response.Write "<script>alert(""发送成功"");location.href=""user_sendmail.asp"";</script>"
Response.End
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>邮件发送</title>
<script>
function valid_register(){

 if(  document.regist.frommail.value.length==""  )
    {window.alert("注意:发件人地址不能为空!");
       document.regist.frommail.focus();
       return false;
      } ;
 if(  document.regist.mailsubject.value.length==""  )
    {window.alert("注意:邮件标题不能为空!");
       document.regist.mailsubject.focus();
       return false;
      } ;
if (document.regist.mailbody.value.length==""  )
  {
  alert("注意:邮件内容不能为空!")
  document.regist.mailbody.focus()
  return false;
};
}
</script>
</head>
<body bgcolor="#E8E8E8">
<div align="center">
<center>
<table border="0" cellspacing="0" cellpadding="4" width="450" bgcolor="#797161" style="border-collapse: collapse" bordercolor="#111111">
<tr bgcolor="#ffcf00">
<td height="23" colspan="2" align="center" bgcolor="#F5F5F5"><b><font size="2">发 送 邮 件</font></b>(本功能需Jmail组件支持)</td>
</tr>
<form action="user_sendmail.asp?action=send" method="post" name="regist" onsubmit="return valid_register()">
<tr bgcolor="#f6f6f6"><td height="25" width="20%" bgcolor="#FFFFFF" align="right" valign="middle">发件人地址:</td>
<td height="25" width="80%" bgcolor="#FFFFFF">
<input type="text" name="frommail" size="24">
</td></tr>
<tr bgcolor="#f6f6f6"><td height="25" width="20%" bgcolor="#FFFFFF" align="right" valign="middle">收件人地址:</td>
<td height="25" width="80%" bgcolor="#FFFFFF">
<input type="text" name="tomail" size="24" value="<%=request("email")%>">&nbsp;(收件人为空则群发邮件)
</td></tr>
<tr bgcolor="#f6f6f6"><td height="25" width="20%" bgcolor="#FFFFFF" align="right" valign="middle">邮件标题:</td>
<td height="25" width="80%" bgcolor="#FFFFFF">
<input type="text" name="mailsubject" size="49" value="<%=webname%>致会员“<%=request("name")%>”通知">
</td></tr>
<tr bgcolor="#f6f6f6"><td height="25" width="20%" bgcolor="#FFFFFF" align="right" valign="top">邮件内容:</td>
<td height="25" width="80%" bgcolor="#FFFFFF">
<textarea name="mailbody" cols="48" rows="8"></textarea>
<p></p>
<p align="center"><input type="submit" value="提交" name="submit">&nbsp;&nbsp;&nbsp;
<input type="reset" value="重置" name="reset"></p>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -