用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包包,挺有有的
下载个精简版的VB6.0,新建 ActiveX dll,以下是封装的代码,重要部分都有注释,不懂可以跟帖
Option Explicit
Public Resp As Response, Requ As Request, Appl As Application, Serv As Server, Sess As Sessio ......
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("\")% >
......
Active Server Pages 提供内建对象,这些对象使用户更容易收集通过浏览器请求发送的信息、响应浏览器以及存储用户信息(如用户首选项)。本文简要说明每一个对象。
Application 对象
可以使用 Application 对象使给定应用程序的所有用户共享信息。
Request 对象
可以使用 Request 对象访问任何用 HTTP 请求 ......
我写了个程序,本地运行完全正常,上传到服务器在服务器上操作有时候能正常操作,但是运行一会儿就服务器连接超时,然后就不能正常操作了,关闭网页,打开还是不能连接数据库操作,等半小时后或者更久又能正常了,请问这个是怎么回事?本地随时都能正常运行切找不出任何问题。高手帮帮忙啊! ......
<%@ Language="VBScript" %>
<%' Option Explicit %>
<%
'不使用输出缓冲区,直接将运行结果显示在客户端
Response.Buffer = False
'声明待检测数组
Dim ObjTotest(26,4)
ObjTotest(0,0) = "MSWC.AdRotator"
ObjTotest(1,0) = "MSWC.BrowserType"
ObjTotest(2,0) = ......