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

📄 sysuseremailsend.asp

📁 asp源码 图片ASP整站
💻 ASP
字号:
<% Option Explicit %>
<!--#include file="../../../Inc/NosqlHack.asp" -->
<!--#include file="../../../Inc/Function.asp" -->
<!--#include file="../../../Inc/Const.asp" -->
<!--#include file="../../../Inc/Cls_DB.asp" -->
<!--#include file="../../../Inc/Cls_User.asp" -->
<%
'==============================================================================
'软件名称:风讯网站信息管理系统
'当前版本:Foosun Content Manager System(FoosunCMS V3.2SP1)
'最新更新:2006.50
'==============================================================================
'Copyright (C) 2002-2004 Foosun.Net  All rights reserved.
'商业注册联系:028-85098980-601,项目开发:028-85098980-606、609,客户支持:608
'产品咨询QQ:394226379,159410,125114015
'技术支持QQ:315485710,66252421 
'项目开发QQ:415637671,655071
'程序开发:四川风讯科技发展有限公司(Foosun Inc.)
'Email:service@Foosun.cn
'MSN:skoolls@hotmail.com
'论坛支持:风讯在线论坛(http://bbs.foosun.net)
'官方网站:www.Foosun.cn  演示站点:test.cooin.com 
'网站通系列(智能快速建站系列):www.ewebs.cn
'==============================================================================
'免费版本请在程序首页保留版权信息,并做上本站LOGO友情连接
'风讯公司保留此程序的法律追究权利
'如需进行2次开发,必须经过风讯公司书面允许。否则将追究法律责任
'==============================================================================
Dim DBC,Conn,UserConn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
DBC.ConnStr = "DBQ=" + Server.MapPath(UserDBConnectStr) + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
Set UserConn = DBC.OpenConnection()
Set DBC = Nothing
%>
<!--#include file="../../../Inc/Session.asp" -->
<!--#include file="../../../Inc/CheckPopedom.asp" -->
<%
if Not (JudgePopedomTF(Session("Name"),"P041001")) then Call ReturnError()
Dim StrUserID,StrUserName,ArrUser,t_i,Fs_User
Set Fs_User = new Cls_User
StrUserID = Replace(Request("UserID"),"'","")
If InStr(StrUserID,"***")>0 Then 
	ArrUser = Split(StrUserID,"***")
else
	ArrUser = Array(StrUserID)
End If 
For t_i=LBound(ArrUser) To UBound(ArrUser)
	If t_i=LBound(ArrUser) Then 
		Fs_User.ID = ArrUser(t_i)
		StrUserName = Fs_User.Email
	Else 
		Fs_User.ID = ArrUser(t_i)
		StrUserName = StrUserName & "," & Fs_User.Email
	End If 
Next
Set Fs_User = Nothing 
If Request.Form("act")="send" Then 
	Dim t_server,t_loginName,t_loginPwd,t_from,t_to,t_subject,t_content,t_ret,t_EmailFrom
	t_server = getConfig(8)
	t_loginName = getConfig(9)
	t_loginPwd = getConfig(10)
	t_EmailFrom = getConfig(2)
	t_from = getConfig(1)
	t_to = Trim(Request.Form("SendTo"))
	t_subject = Trim(Request.Form("title"))
	t_content = Trim(Request.Form("MailContent"))
	If t_subject="" Or t_content="" Then 
		Response.write "<script>alert('邮件主题和内容不能为空');history.back();</script>"
		Response.End 
	End If 
	t_ret = SendGroupMail(t_server,t_loginName,t_loginPwd,t_from,t_EmailFrom,t_to,t_subject,t_content)
	If t_ret Then 
		Response.write "<script>alert('发送成功!');location='SysUserEmail.asp';</script>"
		Response.End 
	Else
		Response.write "<script>alert('发送失败!');history.back();</script>"
		Response.End 
	End If 
End If 

'群发邮件
Function SendGroupMail(SMTPServer,loginName,LoginPass,NameSendFrom,EmailSendFrom,StrSendTo,StrSubject,StrContent)
	On error resume next
	Dim ObjJmail,ArrSendTo,i
	If InStr(StrSendTo,",")>0 Then 
		ArrSendTo = Split(StrSendTo,",")
	Else
		ArrSendTo = Array(StrSendTo)
	End If 
	Set ObjJmail = Server.CreateObject("JMail.Message") 
	'2006-4-27
	If Err Then 
		Err.clear
		Response.write "服务器不支持Jmail组件,请联系管理员安装!<a href=""JavaScript:history.back()"">后退</a>"
		Response.End 
	End If 
	'================
	ObjJmail.Silent = True
	ObjJmail.Logging = True
	ObjJmail.Charset = "gb2312" 
	ObjJmail.MailServerUserName = LoginName 
	ObjJmail.MailServerPassword = LoginPass 
	ObjJmail.ContentType = "text/html" 
	ObjJmail.From = EmailSendFrom
	ObjJmail.FromName = NameSendFrom
	ObjJmail.Subject = StrSubject
	For i=LBound(ArrSendTo) To UBound(ArrSendTo)
		ObjJmail.AddRecipient ArrSendTo(i)
	Next 
	ObjJmail.Body = StrContent 
	ObjJmail.Priority = 3  '邮件的优先级,可以范围从1到5。越大的优先级约高
	ObjJmail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
	if not ObjJmail.Send(SMTPServer) then
		SendGroupMail = false
'		Response.Write("邮件发送失败,可能是服务器不支持JMAIL组件,请使用jmail4.3以上版本!<br>")
	Else
		SendGroupMail = true
'		Response.Write("邮件已经发送到你注册的邮箱中,请注意查收<br>")
	End If
	ObjJmail.Close
	Set ObjJmail=nothing   
End Function

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>发送短信</title>
</head>
<link href="../../../CSS/FS_css.css" rel="stylesheet">
<script src="../../SysJS/PublicJS.js" language="JavaScript"></script>
<body scrolling=no leftmargin="2" topmargin="2">
<form action="" id="MessageForm" method="post" name="MessageForm">
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#999999">
  <tr bgcolor="#EEEEEE"> 
    <td height="26" colspan="5" valign="middle">
      <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width=35 align="center" alt="发送" onClick="document.MessageForm.submit();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">发送</td>
		  <td width=2 class="Gray">|</td>
		  <td width=35 align="center" alt="后退" onClick="top.GetEkMainObject().history.back();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">后退</td><input type="hidden" name="act" value="send">
		  <td>&nbsp; </td>
        </tr>
      </table>
	  </td>
  </tr>
</table>
  <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DDDDDD">
    <tr> 
      <td width="100" height="26" bgcolor="#E8E8E8" width="80"> 
        <div align="right">邮件主题</div></td>
      <td bgcolor="#FFFFFF"> 
        <input value="" name="title" style="width:70%;" type="text" size="36"> </td>
    </tr>
    <tr> 
      <td height="26" bgcolor="#E8E8E8"> 
        <div align="right">收信人</div></td>
      <td bgcolor="#FFFFFF"> 
        <input style="width:70%;" value="<%=StrUserName%>" name="SendTo" type="text" id="SendTo" size="36" ></td>
    </tr>
    <tr> 
      <td height="26" bgcolor="#E8E8E8"> 
        <div align="right">邮件服务器</div></td>
      <td bgcolor="#FFFFFF"> 
        <input style="width:70%;" value="<%=getConfig(8)%>" name="EmailServer" type="text" id="EmailServer" size="36" maxlength="50" readonly><font color="red">请在新闻系统参数里设置</font></td>
    </tr>
    <tr> 
      <td height="26" bgcolor="#E8E8E8"> 
        <div align="right">发信帐号</div></td>
      <td bgcolor="#FFFFFF"> 
        <input style="width:70%;" value="系统管理员(<%=getConfig(2)%>)" name="SendFrom" type="text" id="SendFrom" size="36" maxlength="50" readonly></td>
    </tr>
    <tr> 
      <td bgcolor="#E8E8E8"> 
        <div align="right">邮件内容</div></td>
      <td bgcolor="#FFFFFF"> 
        <textarea style="width:70%;" name="MailContent" cols="34" rows="8" id="textarea"></textarea>
      </td>
    </tr>
</table>
</form>
</body>
</html>
<%
Set Conn = Nothing
Set UserConn = Nothing 
%>

⌨️ 快捷键说明

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