易截截图软件、单文件、免安装、纯绿色、仅160KB

用ASP发送邮件


'creat by qqlxinye@tom.com
'time 2008-09-19
'qq:273453129
'web www.qqlxinye.cn
dim outSmtp,outUser,outPsd,recUser,recSubmit,bodyContent,AddAttachment,ifsend
function init_mail(str1,str2,str3,str4,str5,str6,str7)
  outSmtp=str1
  outUser=str2
  outPsd=str3
  recUser=str4
  recSubmit=str5
  bodyContent=str6
  AddAttachment=str7
  if isnull(outSmtp)or isnull(outUser)or isnull(outPsd) or isnull(recUser) or isnull(recSubmit) or isnull(bodyContent)  then
   ifsend=false
  end if
end function
function send()
  if not ifsend then
   Const cdoSendUsingMethod="http://schemas.microsoft.com/cdo/configuration/sendusing"
  Const cdoSendUsingPort=2
  Const cdoSMTPServer="http://schemas.microsoft.com/cdo/configuration/smtpserver"
  Const cdoSMTPServerPort="http://schemas.microsoft.com/cdo/configuration/smtpserverport"
  Const cdoSMTPConnectionTimeout="http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
  Const cdoSMTPAuthenticate="http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
  Const cdoBasic=1
  Const cdoSendUserName="http://schemas.microsoft.com/cdo/configuration/sendusername"
  Const cdoSendPassword="http://schemas.microsoft.com/cdo/configuration/sendpassword"
 
  Dim objConfig ' As CDO.Configuration
  Dim objMessage ' As CDO.Message
  Dim Fields ' As ADODB.Fields
 
  Set objConfig = Server.CreateObject("CDO.Configuration")
  Set Fields = objConfig.Fields
 
  With Fields
  .Item(cdoSendUsingMethod) = cdoSendUsingPort
  .Item(cdoSMTPServer) =outSmtp
  .Item(cdoSMTPServerPort) = 25
  .Item(cdoSMTPConnectionTimeout) = 10
  .Item(cdoSMTPAuthenticate) = cdoBasic
  .Item(cdoSendUserName) = outUser
  .Item(cdoSendPassword) = outPsd
  .Update
  End With
 
  Set objMe


相关文档:

ASP 编程中 20 个非常有用的例子

1.如何用Asp判断你的网站的虚拟物理路径
答:使用Mappath方法
< p align="center" >< font size="4" face="Arial" >< b >
The Physical path to this virtual website is:
< /b >< /font >
< font color="#FF0000" size="6" face="Arial" >
< %= Server.MapPath("\")% >
......

asp将数据库的数据转换成excel导出

<% '--------------------------------------------------------------------------------------------------
Set rs9 = Server.CreateObject("ADODB.RecordSet")
sqlstr="select * from 客户资料库 order by id desc"
rs9.open sqlstr,conn,1,3
%>
<%Set fs = server.CreateObject( ......

Asp常用通用函数之Cookie防乱码

 '函数名:CodeCookie
  '作 用:Cookie防乱码写入时用
  '参 数:str ---- 字符串
  '返回值:整理后的字符串
  '示 例:
  '**************************************************
  Public Function CodeCookie(str)
   If is ......

ASP初学者常犯的几个错误

 1.记录集关闭之前再次打开:
  ------------------------------------
  sql="select * from test"
  rs.open sql,conn,1,1
  if not rs.eof then
  dim myName
  myName=rs("name")
  end if
  sql="select * from myBook"
  rs.open sql,conn,1,1
  ------------------------------------ ......

asp探针

<%@ Language="VBScript" %>
<%' Option Explicit %>
<%
'不使用输出缓冲区,直接将运行结果显示在客户端
Response.Buffer = False
'声明待检测数组
Dim ObjTotest(26,4)
ObjTotest(0,0) = "MSWC.AdRotator"
ObjTotest(1,0) = "MSWC.BrowserType"
ObjTotest(2,0) = ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号