📄 emailsend.asp
字号:
<%@LANGUAGE="VBScript" CODEPAGE="936"%>
<!--#include file="SESSION.asp" -->
<!--#include file="CONN.asp" -->
<!--#include file="incEmail.asp" -->
<%
if request.ServerVariables("REQUEST_METHOD")="POST" then
if session("usergroup")=1 then
response.write"<script>alert('对不起,您还没有经过同学验证,无权发布消息!');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
response.end
end if
strsql="select username,email from [user] where username='"&session("username")&"'"
set rs1=server.CreateObject("adodb.recordset")
rs1.open strsql,conn,1,1
subject=request.Form("subject")
message=request.Form("message")
recipient=request.Form("recipient")
recipient=replace(recipient,",",";")
senderemail=rs1("email")
rs1.close
set rs1=nothing
stat=sendmail(recipient,senderemail,subject,message)
If stat="ok" Then
errmsg="发送邮件成功!"
else
errmsg=stat
end if
end if
set rs=server.CreateObject("adodb.recordset")
strsql="select username,realname,email from [user] where isvalid=true"
rs.open strsql,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<title><%=classname%>同学录--班级群体邮件</title>
<link href="css/class.css" type=text/css rel=stylesheet>
<script language="JavaScript">
<!--
function checkform()
{if (document.form1.subject.value.length==0) {
alert("请填写信息标题!");
document.form1.subject.focus();
return false;
}
if (document.form1.message.value.length==0) {
alert("请填写正文!");
document.form1.message.focus();
return false;
}
if (document.form1.recipient.value.length==0) {
alert("请选择收信人!");
document.form1.recipient.focus();
return false;
}
return true
}
//-->
</script>
</head>
<body background="images/1.GIF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><img src="images/top_t.gif" width="776" height="43"></td>
</tr>
<tr>
<td width="138"><img src="images/top_l.gif" width="138" height="39"></td>
<td width="584" align="right" bgcolor="#666B52"><a href="index.asp"><img src="images/toplogo.gif" alt="<%=classname%>同学录" width="200" height="39" border="0"></a></td>
<td width="54"><img src="images/top_r.gif" width="54" height="39"></td>
</tr>
<tr>
<td colspan="3"><table width="776" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120" rowspan="2" valign="top" background="images/left_x.gif"><img src="images/left_img.gif" width="120" height="480"></td>
<td rowspan="2" valign="top" bgcolor="#F2F2EA"> <div align="center">
<!--#include file="top.asp" -->
</div>
<table width="618" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"> <div align="center"><br>
<!--#include file="left.asp" -->
</div></td>
<td width="10"> </td>
<td width="418" valign="top"><table width="400" border="0" align="center" cellpadding="1" cellspacing="3" class="font1">
<tr>
<td>您的位置>班级群体邮件 </td>
</tr>
</table>
<div align="center">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="400" border="0" cellpadding="0" cellspacing="0" background="images/gnymtbz.gif">
<tr>
<td width="135"><img src="images/yjqf.gif" width="135" height="36"></td>
<td> </td>
<td width="100"><img src="images/gnymtyb.gif" width="100" height="36"></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="400" border="0" cellpadding="0" cellspacing="0" background="images/email_bk.gif">
<tr>
<td><form name="form1" method="post" action="emailsend.asp" onSubmit="return checkform()">
<table width="400" border="0" cellpadding="2" cellspacing="3">
<tr>
<td width="70%" valign="top"><table width="100%" border="0" cellspacing="4" cellpadding="1">
<tr>
<td bgcolor="fafbf2"> <span class="font1"><strong>信息标题:</strong></span><strong><font color="#FF0000"><%=Errmsg%></font></strong></td>
</tr>
<tr>
<td colspan="2">
<input name="subject" type="text" class="input-box" id="topic3" size="40"height="20">
</td>
</tr>
<tr>
<td colspan="2" bgcolor="fafbf2" class="font1"><strong>正文:</strong>(<font color="#FF6600">不超过1000字</font>)</td>
</tr>
<tr>
<td colspan="2"><textarea name="message" cols="40" rows="10" class="input-box" id="textarea3"></textarea></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input name="Submit3" type="submit" value="提交">
<input name="Submit22" type="reset" value="重置">
</div></td>
</tr>
</table></td>
<td width="30%" valign="top"> <table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr>
<td><div align="center">班级成员列表</div></td>
</tr>
<tr>
<td> <div align="center">
<select name="recipient" size="14" multiple id="recipient">
<%if not rs.eof then%>
<%do while not rs.eof%>
<option value="<%=rs("email")%>"> <%=rs("realname")%> </option>
<%rs.movenext
loop
end if
rs.close
set rs=nothing%>
</select>
</div></td>
</tr>
</table></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
<tr>
<td><img src="images/n_foot.gif" width="400" height="10"></td>
</tr>
</table>
</div></td>
</tr>
</table></td>
<td width="38" valign="top" background="images/right_b.gif"><img src="images/right_b.gif" width="38" height="5"></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3"><img src="images/z_f.gif" width="776" height="26"></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -