📄 sendmail.asp
字号:
<!--#include file="../checkpost.asp"-->
<!--#include file="articleconn.asp"-->
<!--#include file="security.asp"-->
<%if session("flag")>3 then
response.write "<br><p align=center>您的操作权限不够!</p>"
response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" type="text/css" href="css/style.css">
<title></title>
</head>
<LINK href="images/forum_admin.css" type=text/css rel=stylesheet>
<body >
<TABLE class=tableBorder height=1 cellSpacing=1 cellPadding=5 width="100%"
align=center border=0>
<TBODY>
<TR>
<TH height=25 style="background-image: url('images/admin_bg_1.gif')"> <b><font style="font-size: 9pt">通 知 会 员</font></span></b></TH></TR></tbody></table>
<form name="sendmail" action="?action=send" method="post">
<div align="center">
<center>
<table border="0" cellspacing="0" cellpadding="4" width="450" bgcolor="#797161" style="border-collapse: collapse" bordercolor="#111111">
<tr bgcolor="#f6f6f6">
<td height="23" colspan="2" align="center" bgcolor="#0099FF">发 送 邮 件</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="frommail" size="20" value="dai035@163.com"> </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="20" value="<%=request("email")%>">
(如果为空,则向所有会员群发!) </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="七彩影院 通知"> </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> <br>
</td>
</tr>
<tr bgcolor="#f6f6f6">
<td height="10" colspan="2" align="center" bgcolor="#FFFFFF">
<input type="submit" name="Submit" value="发送">
<input type="reset" name="Submit" value="取消"> </td>
</tr>
</table>
</center>
</div>
</form>
</body>
<%
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"))
smtpserver ="ip"
smtpuser ="dai035@163.com"
smtppwd ="pass"
if tomail<>"" then
' 创建jmail对象:
Set JMail = Server.CreateObject("JMail.Message")
'身分验证
JMail.MailServerUserName = smtpuser
JMail.MailServerPassword = smtppwd
JMail.Charset ="gb2312"
JMail.ContentType = "text/html"
JMail.from = frommail
JMail.AddRecipient(""&tomail&"")
JMail.Subject = mailsubject
JMail.Body = mailbody
JMail.Priority = 3
JMail.Send(smtpserver)
JMail.Close()
Set JMail=nothing
else
' 创建jmail对象:
Set JMail = Server.CreateObject("JMail.Message")
'身分验证
JMail.MailServerUserName = smtpuser
JMail.MailServerPassword = smtppwd
JMail.Charset ="gb2312"
JMail.ContentType = "text/html"
JMail.from = 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.Send(smtpserver)
JMail.Close()
Set JMail=nothing
end if
Response.Write "<script>alert(""发送成功"");location.href=""sendmail.asp"";</script>"
Response.End
end if
%>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -