ASP中的VBS [英] VBS in ASP

查看:51
本文介绍了ASP中的VBS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉我为什么我可能会收到500错误

试图在ASP中使用这个VBS模板?唯一能让我在ASP中工作的
是为了
添加Server.CreateObject而不是CreateObject。

但是,显然还有更多的东西。 WITH

语句是否可以或者是否需要更改?


Dim iMsg

Dim iConf

Dim Flds

Dim strHTML


Const cdoSendUsingPickup = 1

set iMsg = Server.CreateObject( CDO.Message)

set iConf = Server.CreateObject(" CDO.Configuration")


设置Flds = iConf.Fields

使用Flds

.Item(" sendusing")= cdoSendUsingPickup

''TODO:替换< PICKUP DIRECTORY>通往你的取件目录的路径

''通常,c:\ Inetpub \ mailroot \ pickup

.Item(" smtpserverpickupdirectory")=" c: \ Inetpub\mailroot \pickup"

。更新

结束


''为邮件正文构建HTML。

strHTML ="< HTML>"

strHTML = strHTML& "< HEAD>"

strHTML = strHTML& "< BODY>"

strHTML = strHTML& "< b取代;这是测试HTML邮件正文< / b>< / br>"

strHTML = strHTML& "< / BODY>"

strHTML = strHTML& "< / HTML>"


Dim iBP

with iMsg

Set .Configuration = iConf

.To =" de **** @ connexions.net"

.From =" de **** @ connexions.net"

.Subject ="这是测试CDOSYS消息(通过皮卡发送)"

.HTMLBody = strHTML

''TODO:如果添加附件,
''取消注释下一行并根据需要更改文件路径

''设置iBP = iMsg.AddAttachment(App.Path&" \ file1.txt")

。发送

结束


''清理变量。

设置iBP = Nothing

设置iMsg = Nothing

设置iConf = Nothing

设置Flds = Nothing

Can anyone tell me why I might be getting a 500 error
trying to use this VBS template in ASP? The only thing
I could see to do to make it work in ASP was to
add Server.CreateObject instead of CreateObject.
But, obviously there is something more. Are the WITH
statements ok or do they need to be changed ?

Dim iMsg
Dim iConf
Dim Flds
Dim strHTML

Const cdoSendUsingPickup = 1

set iMsg = Server.CreateObject("CDO.Message")
set iConf = Server.CreateObject("CDO.Configuration")

Set Flds = iConf.Fields
With Flds
.Item("sendusing") = cdoSendUsingPickup
'' TODO: Replace <PICKUP DIRECTORY> with path to your pickup directory
'' Typically, c:\Inetpub\mailroot\pickup
.Item("smtpserverpickupdirectory")= "c:\Inetpub\mailroot\pickup"
.Update
End With

'' Build HTML for message body.
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<b> This is the test HTML message body</b></br>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"

Dim iBP
With iMsg
Set .Configuration = iConf
.To = "de****@connexions.net"
.From = "de****@connexions.net"
.Subject = "This is a test CDOSYS message (Sent via Pickup)"
.HTMLBody = strHTML
''TODO: if adding an attachment,
''uncomment the next line and alter file path as required
''Set iBP = iMsg.AddAttachment(App.Path & "\file1.txt")
.Send
End With

'' Clean up variables.
Set iBP = Nothing
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

推荐答案

http://www.aspfaq.com/show .asp?id = 2109

" Fox" < fox @ connexions .net>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP11.phx.gbl ...
http://www.aspfaq.com/show.asp?id=2109
"Fox" <fox @ connexions .net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
任何人都可以告诉我为什么我可能会收到500错误
试图在ASP中使用这个VBS模板?我能做的唯一能让它在ASP中工作的是
添加Server.CreateObject而不是CreateObject。
但是,显然还有更多东西。 WITH
语句是否正确或是否需要更改?

Dim iMsg
Dim iConf
Dim Flds
Dim strHTML

Const cdoSendUsingPickup = 1
设置iMsg = Server.CreateObject(" CDO.Message")
设置iConf = Server.CreateObject(" CDO.Configuration")

使用Flds设置Flds = iConf.Fields
.Item(" sendusing")= cdoSendUsingPickup
''TODO:替换< PICKUP DIRECTORY>通往您的取件目录的路径
''通常,c:\ Inetpub \ mailroot \ pickup
.Item(" smtpserverpickupdirectory")=" c:\Inetpub\mailroot \拾取
。更新
结束

''为邮件正文构建HTML。
strHTML ="< HTML>"
strHTML = strHTML& "< HEAD>"
strHTML = strHTML& "< BODY>"
strHTML = strHTML& "< b取代;这是测试HTML邮件正文< / b>< / br>"
strHTML = strHTML& "< / BODY>"
strHTML = strHTML& "< / HTML>"

Dim iBP
使用iMsg
设置.Configuration = iConf
.To =" de **** @ connexions .net"
.From =" de **** @ connexions.net"
.Subject ="这是测试CDOSYS消息(通过皮卡发送)"
.HTMLBody = strHTML
''TODO:如果添加附件,
''取消注释下一行并根据需要更改文件路径
''设置iBP = iMsg.AddAttachment(App.Path&" ; \ file1.txt")
。发送
结束

''清理变量。
设置iBP = Nothing
设置iMsg = Nothing
设置iConf = Nothing
设置Flds = Nothing
Can anyone tell me why I might be getting a 500 error
trying to use this VBS template in ASP? The only thing
I could see to do to make it work in ASP was to
add Server.CreateObject instead of CreateObject.
But, obviously there is something more. Are the WITH
statements ok or do they need to be changed ?

Dim iMsg
Dim iConf
Dim Flds
Dim strHTML

Const cdoSendUsingPickup = 1

set iMsg = Server.CreateObject("CDO.Message")
set iConf = Server.CreateObject("CDO.Configuration")

Set Flds = iConf.Fields
With Flds
.Item("sendusing") = cdoSendUsingPickup
'' TODO: Replace <PICKUP DIRECTORY> with path to your pickup directory
'' Typically, c:\Inetpub\mailroot\pickup
.Item("smtpserverpickupdirectory")= "c:\Inetpub\mailroot\pickup"
.Update
End With

'' Build HTML for message body.
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<b> This is the test HTML message body</b></br>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"

Dim iBP
With iMsg
Set .Configuration = iConf
.To = "de****@connexions.net"
.From = "de****@connexions.net"
.Subject = "This is a test CDOSYS message (Sent via Pickup)"
.HTMLBody = strHTML
''TODO: if adding an attachment,
''uncomment the next line and alter file path as required
''Set iBP = iMsg.AddAttachment(App.Path & "\file1.txt")
.Send
End With

'' Clean up variables.
Set iBP = Nothing
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing



> http://www.aspfaq.com/show.asp?id= 2109

" Mike D" <弥*** @ nospam.com>在消息中写道

news:O
> http://www.aspfaq.com/show.asp?id=2109
"Mike D" <Mi***@nospam.com> wrote in message
news:O


************* @ TK2MSFTNGP11.phx.gbl ...
*************@TK2MSFTNGP11.phx.gbl...
http://www.aspfaq.com/show .asp?id = 2109

" Fox" < fox @ connexions .net>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP11.phx.gbl ...
http://www.aspfaq.com/show.asp?id=2109
"Fox" <fox @ connexions .net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
谁能告诉我为什么我可能会出现500错误尝试在ASP中使用此VBS模板?我能做的唯一能让它在ASP中工作的是
添加Server.CreateObject而不是CreateObject。
但是,显然还有更多东西。 WITH
语句是否正确或是否需要更改?

Dim iMsg
Dim iConf
Dim Flds
Dim strHTML

Const cdoSendUsingPickup = 1
设置iMsg = Server.CreateObject(" CDO.Message")
设置iConf = Server.CreateObject(" CDO.Configuration")

使用Flds设置Flds = iConf.Fields
.Item(" sendusing")= cdoSendUsingPickup
''TODO:替换< PICKUP DIRECTORY>通过拾取路径
目录''通常,c:\ Inetpub \ mailroot \ pickup
.Item(" smtpserverpickupdirectory")=" c:\Inetpub \ mailroot \拾取
。更新
结束

''为邮件正文构建HTML。
strHTML ="< HTML>"
strHTML = strHTML& "< HEAD>"
strHTML = strHTML& "< BODY>"
strHTML = strHTML& "< b取代;这是测试HTML邮件正文< / b>< / br>"
strHTML = strHTML& "< / BODY>"
strHTML = strHTML& "< / HTML>"

Dim iBP
使用iMsg
设置.Configuration = iConf
.To =" de **** @ connexions .net"
.From =" de **** @ connexions.net"
.Subject ="这是测试CDOSYS消息(通过皮卡发送)"
.HTMLBody = strHTML
''TODO:如果添加附件,
''取消注释下一行并根据需要更改文件路径
''设置iBP = iMsg.AddAttachment(App.Path&" ; \ file1.txt")
。发送
结束

''清理变量。
设置iBP = Nothing
设置iMsg = Nothing
设置iConf = Nothing
设置Flds = Nothing
Can anyone tell me why I might be getting a 500 error
trying to use this VBS template in ASP? The only thing
I could see to do to make it work in ASP was to
add Server.CreateObject instead of CreateObject.
But, obviously there is something more. Are the WITH
statements ok or do they need to be changed ?

Dim iMsg
Dim iConf
Dim Flds
Dim strHTML

Const cdoSendUsingPickup = 1

set iMsg = Server.CreateObject("CDO.Message")
set iConf = Server.CreateObject("CDO.Configuration")

Set Flds = iConf.Fields
With Flds
.Item("sendusing") = cdoSendUsingPickup
'' TODO: Replace <PICKUP DIRECTORY> with path to your pickup directory '' Typically, c:\Inetpub\mailroot\pickup
.Item("smtpserverpickupdirectory")= "c:\Inetpub\mailroot\pickup"
.Update
End With

'' Build HTML for message body.
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<b> This is the test HTML message body</b></br>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"

Dim iBP
With iMsg
Set .Configuration = iConf
.To = "de****@connexions.net"
.From = "de****@connexions.net"
.Subject = "This is a test CDOSYS message (Sent via Pickup)"
.HTMLBody = strHTML
''TODO: if adding an attachment,
''uncomment the next line and alter file path as required
''Set iBP = iMsg.AddAttachment(App.Path & "\file1.txt")
.Send
End With

'' Clean up variables.
Set iBP = Nothing
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing







我已经超过了该页面上的建议。

我的错误配置是它需要的内容

显示服务器和IE中的详细信息..


我真正需要的是一个人

来看看为什么te mplate

适用于VBS,而不适用于ASP?


我唯一可以想出的是

可能是命令WITH。

不知道你们中的很多人,我不知道是否b $ b知道WITH是什么在ASP页面中工作,就像在VBS中那样,或者需要转换为ASP吗?


或者这个脚本中还有其他问题吗?


谢谢,

Fox



Hi,

I am already past the suggestions on that page.
My error configuration is what it needs to be to
show details in the server and in IE..

What I really need is for someone
to take a look to see why the template
works in VBS and not in ASP?.

The only thing I can come up with is
possibly the command "WITH".
Not knowing as much as many of you, I do not
know if "WITH" works in an ASP page as it does in
the VBS or does that need to be converted for ASP ?

Or is there another problem in this script?

thanks,
Fox


这篇关于ASP中的VBS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆