<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<html>
<head>
<title>发送邮件</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FFFFFF;
}
-->
</style>
<link href="cs.css" rel="stylesheet" type="text/css">

<style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
.style2 {color: #FF0000}
-->
</style>
<script language="javascript">
function check(obj){
	with(obj){
		if(m_to.value==""){
			alert("收件人不能为空!");
			m_to.focus();
			return false;
		}
		if(m_from.value==""){
			alert("发件人不能为空!");
			m_from.focus();
			return false;
		}
		if(m_title.value==""){
			alert("标题不能为空!");
			m_title.focus();
			return false;
		}
		if(m_content.value==""){
			alert("内容不能为空!");
			m_content.focus();
			return false;
		}
		if(m_smtp.value==""){
			alert("邮箱服务器不能为空!");
			m_smtp.focus();
			return false;
		}
		if(m_loginuser.value==""){
			alert("登录用户名不能为空!");
			m_loginuser.focus();
			return false;
		}
		if(m_loginpass.value==""){
			alert("登录密码不能为空!");
			m_loginpass.focus();
			return false;
		}		
		return true;
	}
}
</script>
</head>
<%
dim act
act=request.QueryString("act")
if(act<>"" and act="send") then
	dim m_to,m_from,m_fromuser,m_title,m_content,m_loginuser,m_loginpass,m_smtp
	'读取信息
	m_to=trim(request.Form("m_to"))
	m_from=trim(request.Form("m_from"))
	m_fromuser=trim(request.Form("m_fromuser"))
	m_title=trim(request.Form("m_title"))
	m_content=trim(request.Form("m_content"))
	m_loginuser=trim(request.Form("m_loginuser"))
	m_loginpass=trim(request.Form("m_loginpass"))
	m_smtp=trim(request.Form("m_smtp"))
	'发送邮件
	Set msg = Server.CreateObject("JMail.Message") 
	msg.silent = true 
	msg.Logging = true 
	msg.Charset = "gb2312" 
	msg.MailServerUserName=m_loginuser 
	msg.MailServerPassword=m_loginpass  '输入smtp服务器验证密码  （用户Email帐号对应的密码） 
	msg.From=m_from    '发件人Email 
	msg.FromName = m_fromuser   '发件人姓名 
	msg.AddRecipient m_to  '收件人Email 
	msg.Subject = m_title  '信件主题 
	msg.Body = m_content     '正文 
	msg.Send (m_smtp)        'smtp服务器地址（企业邮局地址） 
	set msg = nothing 
	response.Write("邮件发送成功!")
end if
%>
<body>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>
<form action="?act=send" method="post" onSubmit="return check(this)" style="margin:0px;">
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999">
  <tr bgcolor="#FF9900">
    <td height="22" colspan="2"><div align="center" class="style1">◆ 发送邮件 ◆</div></td>
  </tr>
  <tr bgcolor="#EEEEEE">
    <td height="22" bgcolor="#EEEEEE"><div align="right">收件人邮箱：</div></td>
    <td bgcolor="#EEEEEE"><div align="left">
      <input name="m_to" type="text" id="m_to" size="30" maxlength="50">
    (<span class="style2">*</span>)</div></td>
  </tr>
  <tr bgcolor="#EEEEEE">
    <td height="22" bgcolor="#EEEEEE"><div align="right">发件人邮箱：</div></td>
    <td bgcolor="#EEEEEE"><div align="left">
      <input name="m_from" type="text" id="m_from" size="30" maxlength="50">
    (<span class="style2">*</span>)</div></td>
  </tr>
  <tr bgcolor="#EEEEEE">
    <td height="22" bgcolor="#EEEEEE"><div align="right">发件人姓名：</div></td>
    <td bgcolor="#EEEEEE"><input name="m_fromuser" type="text" id="m_fromuser" size="10" maxlength="10"></td>
  </tr>
  <tr bgcolor="#EEEEEE">
    <td height="22" bgcolor="#EEEEEE"><div align="right">主题：</div></td>
    <td bgcolor="#EEEEEE"><div align="left">
      <input name="m_title" type="text" id="m_title" size="50" maxlength="50">
    (<span class="style2">*</span>)</div></td>
  </tr>
  <tr bgcolor="#EEEEEE">
    <td height="22" bgcolor="#EEEEEE"><div align="right">内容：</div></td>
    <td bgcolor="#EEEEEE"><div align="left">
      <textarea name="m_content" cols="50" rows="5" id="m_content"></textarea>
    (<span class="style2">*</span>)</div></td>
  </tr>
  <tr bgcolor="#EEEEEE">
    <td height="22" bgcolor="#EEEEEE"><div align="right">邮件服务器地址：</div></td>
    <td bgcolor="#EEEEEE"><input name="m_smtp" type="text" id="m_smtp" size="30" maxlength="50">
      (<span class="style2">*</span>)</td>
  </tr>
  <tr bgcolor="#EEEEEE">
    <td height="22" bgcolor="#EEEEEE"><div align="right">邮箱登录用户名：</div></td>
    <td bgcolor="#EEEEEE"><div align="left">
      <input name="m_loginuser" type="text" id="m_loginuser" size="30" maxlength="50">
    (<span class="style2">*</span>)</div></td>
  </tr>
  <tr bgcolor="#EEEEEE">
    <td width="35%" height="22" bgcolor="#EEEEEE"><div align="right">邮箱登录密码：：</div></td>
    <td width="65%" bgcolor="#EEEEEE"><div align="left">
      <input name="m_loginpass" type="password" id="m_loginpass" size="30" maxlength="50">
    (<span class="style2">*</span>)</div></td>
    </tr>
  
  <tr>
    <td height="22" colspan="2" bgcolor="#FFFFFF"><div align="center">
      <input type="submit" name="Submit" value="发 送">&nbsp;&nbsp;
      <input type="reset" name="Submit2" value="重 写">
    </div></td>
  </tr>
  <!--按行循环结束------------------------>
</table>
</form>
<p align="center">注：此附件使用了JMail.Message组件，请确认您的服务器提供了JMail.Message支持。</p>
</body>
</html>
<%
call connclose()
%>
