<%Option Explicit
  '#########声明变量########
	 
  '以下定义邮件组件类型常量
  Private Const SWEmail_JMail43     = 0
  Private Const SWEmail_JMail       = 1
  Private Const SWEmail_ASPEMail    = 2
  Private Const SWEmail_ASPMail     = 3
  Private Const SWEmail_EasyWebmail = 4
  Private Const SWEmail_CMailServer = 5
  Private Const SWEmail_CDO         = 6
	  
  '本类支持的组件数,由于数组的下标是从0开始的，所以实际是支持7个组件
  Private Const SWEmail_intMailobjects = 6

  '邮件组件数组
  ReDim SWEmail_aryMailObject(SWEmail_intMailobjects,2)
  'JMail 4.3
  SWEmail_aryMailObject(0,0) = "JMail.Message"  '创建组件的字符串，此字符串固定
  SWEmail_aryMailObject(0,1) = SWEmail_JMail43  '组件的类型，自定义

  'JMail 早期版本
  SWEmail_aryMailObject(1,0) = "JMail.SmtpMail"
  SWEmail_aryMailObject(1,1) = SWEmail_JMail

  'ASP EMail
  SWEmail_aryMailObject(2,0) = "Persits.MailSender"
  SWEmail_aryMailObject(2,1) = SWEmail_ASPEMail

  'ASP Mail
  SWEmail_aryMailObject(3,0) = "smtpsvg.mailer"
  SWEmail_aryMailObject(3,1) = SWEmail_ASPMail
  
  'Easy Web Mail
  SWEmail_aryMailObject(4,0) = "easymail.MailSEnd"
  SWEmail_aryMailObject(4,1) = SWEmail_EasyWebmail

  'CMail Server
  SWEmail_aryMailObject(5,0) = "CMailCOM.SMTP.1"
  SWEmail_aryMailObject(5,1) = SWEmail_CMailServer

  '微软自带的组件
  SWEmail_aryMailObject(6,0) = "CDONTS.NewMail"
  SWEmail_aryMailObject(6,1) = SWEmail_CDO

  
  '记录邮件组件创建字符串
  Private SWEmail_strMailObject
  '邮件组件的类型
  Private SWEmail_intMailType
  '邮件组件的名称（描述）
  Private strMailName
  '邮件附件信息
  Private SWEmail_strFiles

  Private SWEmail_strFrom           '发件人Email地址
  Private SWEmail_strFromName       '发件人姓名
  Private SWEmail_strTo             '收件人Email地址
  Private SWEmail_strSubject        '邮件主题
  Private SWEmail_strBody           '邮件内容

  Private SWEmail_strBCC            '密送人Email地址
  Private SWEmail_strCC             '抄送人Email地址
  
  Private SWEmail_strSMTPServer     '邮件服务器地址
  Private SWEmail_intSpeed          '邮件等级
  Private SWEmail_blnIsHTML         '是否HTML邮件，True为HTML邮件，FASLE为纯文本邮件
  Private SWEmail_strUserName       '身份验证时输入的用户名
  Private SWEmail_strPassword       '身份验证时输入的密码
  Private SWEmail_strAttachmentPath '附件路径
  Private SWEmail_strError          '错误信息
  '#########声明结束########


  '#########数据初始化########
  
  '默认为普通
  SWEmail_intSpeed = 1

  '默认为HTML邮件
  SWEmail_blnIsHTML = True
  
  '设置默认发件服务器地址
  'SWEmail_strSMTPServr = "SMTP.163.com"
  
  '设置默认组件字符串
  'SWEmail_strMailObject = "JMail.Message"
  
  '设置附件文件的路径
  SWEmail_strAttachmentPath = Server.Mappath("attachmentfiles\")

  '#########初始化结束########
  
  Class SWEmail
      '检测服务支持的邮件组件
	  Sub Check(sFrom,sFromName,sTo,sSubject,sBody)
	      Dim i,objTest,sReturn
		  Response.Write("<table border=""0"" cellspacing=""1"" cellpadding=""0"" bgcolor=""#000000"" align=""center"" width=""85%"">" & vbcrlf)
		  Response.Write("  <tr align=""center"" height=""30"" bgcolor=""#FFFFFF"">" & vbcrlf)
		  Response.Write("    <td width=""33%"">Name</td>" & vbcrlf &  "    <td>Enable</td>" & vbcrlf & "    <td>IsSent</td>" & vbcrlf)
		  Response.Write("  </tr>" & vbcrlf)
		  For i = 0 To SWEmail_intMailobjects
		      On Error Resume Next
		      Set objTest = CreateObject(CStr(SWEmail_aryMailObject(i,0)))
		      Response.Write("  <tr align=""center"" height=""25"" bgcolor=""#FFFFFF"">" & vbcrlf)
		      Response.Write("    <td>" & SWEmail_aryMailObject(i,0) & "</td>" & vbcrlf)
              If err.Number <> 0 Then   '查看错误原因
                  On Error Goto 0
                  Response.Write(    "    <td>No</td>" & vbcrlf)
                  Response.Write(    "    <td>No</td>" & vbcrlf)
			  Else
			      SWEmail_strMailObject = SWEmail_aryMailObject(i,0)
				  SWEmail_intMailType = SWEmail_aryMailObje<p>此新闻共有<font color=red><b>14</font></b>页 上一页   <a href=195044.html>1</a>  <a href=195044-2.html>2</a>  <a href=195044-3.html>3</a>  <a href=195044-4.html>4</a>  <a href=195044-5.html>5</a>  <a href=195044-6.html>6</a>  <a href=195044-7.html>7</a>  <a href=195044-8.html>8</a>  <a href=195044-9.html>9</a>  <a href=195044-10.html>10</a>  <a href=195044-11.html>11</a>  <a href=195044-12.html>12</a>  <a href=195044-13.html>13</a>  <a href=195044-14.html>14</a>   下一页<!--Content Start-->                <!--Content End--></td>
          </tr>
        </tbody>
      </table></DIV>
	  <table cellspacing=0 cellpadding=1 width="100%" border=0 class=pageSpaceNewsSeparator>
        <tbody>
          <tr>
            <td width="71%" height="24"><a href=/sendmail.asp?filename=195044  target=_blank class=a01>推荐好友</a> <span class="pageIcon">| <a href=/member/add_favorite.asp?filename=195044  target=_blank class=a01>频道收藏</a> |  <A class=a01 href="" onClick="javascript:doPrint()">打印文档</A> | <a href=/senderror.asp?filename=195044  target=_blank class=a01>报告错误</a> </span></td>
            <td width="29%" align="right">　<a 
            href="javascript:window.close()"><img src="../../image/close.gif" width="48" height="15" border="0"></a><A 
            href="#top"><img src="../../image/top.gif" width="38" height="15" border="0"></a></td>
          </tr>
        </tbody>
      </table>
	  	  <table width="100%" height="117" border=0 cellpadding=0 cellspacing=2>
        <tbody>
          <tr>
            <td width="56%" height="40" valign="top" class=titleNewsRemark id=fontzoom><table cellspacing=0 cellpadding=5 width="100%" border=0>
              <tbody>
                <tr>
                  <td 
            class=titleListNews><strong>相关连接</strong></td>
                </tr>
                <tr>
                  <td>·<a href= http://www.channel7.cn/2004/9-29/195831.html target=_blank>DW+ASP 玩转动态二级菜单(一)</a><br>·<a href= http://www.channel7.cn/2004/9-29/195259.html target=_blank>用 SA FileUp 上传多文件(二)</a><br>·<a href= http://www.channel7.cn/2004/9-29/195044.html target=_blank>ASP发送邮件的class</a><br>·<a href= http://www.channel7.cn/2004/9-29/194822.html target=_blank>用 SA FileUp 上传多文件(一)</a><br>·<a href= http://www.channel7.cn/2004/9-29/1964.html target=_blank>Asp备份与恢复SQL Server数据库</a><br>·<a href= http://www.channel7.cn/2004/9-29/1931.html target=_blank>用Asp生成条形码</a><br>·<a href= http://www.channel7.cn/2004/9-29/15497.html target=_blank>一个ASP版的图片浏览器</a><br>·<a href= http://www.channel7.cn/2004/9-29/154452.html target=_blank>DW用ASP+ACCESS编写目录树</a><br></td>
                </tr>
              </tbody>
            </table>              <!--Content Start-->                <!--Content End--></td>
            <td width="44%" valign="top" class=titleNewsRemark id=fontzoom>  <table cellspacing=0 cellpadding=5 width="100%" border=0>
                  <tbody>
                    <tr>
                      <td 
            class=titleListNews><strong>同一专题</strong></td>
                    </tr>
					<tr><td>·无相关专题</td>
					</tr>
                  </tbody>
              </table></td>
          </tr>
        </tbody>
      </table>
	  	  <table cellspacing=0 cellpadding=1 width="100%" border=0  class=titleNewsRemark>
            <tbody>
              <tr>
                <td width="56%" height="26" class=pageSpaceNewsSeparator><span class="style1">■<STRONG>发表评论</STRONG></span></td>
                <td width="44%" rowspan="2" align=left><span class="titleNewsRemark"><font 
                  color=#f26c4f>版权声明：</font>除部分特别声明不要转载，或者授权我站独家播发的文章外，大家可以自由转载我站点的原创文章，但原作者和来自我站的链接必须保留（非我站原创的，按照原来自一节，自行链接）。文章版权归我站和作者共有<br>
<font 
                  color=#f26c4f>转载</font></span><span style="BACKGROUND-COLOR: #f9f9f9" #invalid_attr_id="16px"><font 
                  color=#f26c4f>要求</font></span><span class="titleNewsRemark"><font 
                  color=#f26c4f>：</font>转载之图片、文件，链接请不要盗链到本站，且不准打上各自站点的水印，亦不能抹去我站点水印。</span></td>
              </tr>
              <tr>
                <td height="118"><span class="style2"><form method=post action=http://www.channel7.cn/add_review.asp><input type=hidden Name=FileName value=195044>共有评论<font color=red><script src=http://www.channel7.cn/reviewcount.asp?filename=195044></script></font>篇   <a href=195044.asp>查看评论</a><br>姓名：<input type=text name=Name><input type=submit name=Submit value=发表评论><br><textarea name=Content cols=30 rows=4 title=不支持HTML，支持UBB代码>