<!--#include file="../config.asp"-->
<!--#include file="../inc/function.asp"-->
<!--#include file="chklogin.asp"-->
<%
dim myemail,topic,mailbody,isgo
topic = request.Form("topic") '邮件标题
mailbody=HTMLcode(request.Form("mailbody")) '邮件内容
myemail=request.QueryString("usermail") '收件人

if request.QueryString("send")=1 then
call sendmail()
end if

sub sendmail()
set jmail= server.CreateObject ("jmail.message")
jmail.Silent = true
jmail.Charset = "gb2312"
JMail.ContentType = "text/html"
jmail.From = mailform
jmail.FromName = sendname
jmail.ReplyTo = mailform
jmail.Subject = topic
jmail.AddRecipient myemail
jmail.Body = mailbody 
jmail.MailServerUserName = mailname
jmail.MailServerPassWord = mailpass


isgo=jmail.Send(mailsmtp)
if isgo then
response.write "<script language=javascript>alert('邮件发送成功！');history.go(-1);</script>"
else
response.write "<script language=javascript>alert('邮件发送失败！');history.go(-1);</script>"
end if

jmail.Close
set jmail = nothing
end sub
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>快问我知道-邮件发送</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FF9999">
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" class="tablebg">
  <tr align="center" bgcolor="#ff6666">
    <td height="26" colspan="2"><font color="#FFFFFF"><b>发送邮件给指定用户</b></font></td>
  </tr>
  <tr bgcolor="#ff6666">
    <td colspan="2" align="center">&nbsp;</td>
  </tr>
  <form action="mail2.asp?send=1&usermail=<%=request.QueryString("usermail")%>" method="post">
  <tr bgcolor="#ff6666">
    <td width="129" height="30" align="center">邮件标题：</td>
    <td width="468">&nbsp;&nbsp;
      <input name="topic" type="text" id="topic" size="50">
  </tr>
  <tr bgcolor="#ff6666">
    <td height="280" align="center">邮件内容：</td>
    <td>&nbsp;&nbsp;
      <textarea name="mailbody" cols="68" rows="16" id="mailbody"></textarea></td>
  </tr>
  <tr align="center" bgcolor="#ff6666">
    <td height="28" colspan="2"><input type="submit" name="Submit" value="发送">&nbsp;&nbsp;
    <input type="reset" name="Submit" value="重置"></td>
  </tr>
  </form>
</table>

</body>
</html>
