''取消注释下一行并根据需要更改文件路径 ''设置iBP = iMsg.AddAttachment(App.Path&" \ file1.txt") 。发送 结束 ''清理变量。 设置iBP = Nothing 设置iMsg = Nothing 设置iConf = Nothing 设置Flds = NothingCan anyone tell me why I might be getting a 500 errortrying to use this VBS template in ASP? The only thingI could see to do to make it work in ASP was toadd Server.CreateObject instead of CreateObject.But, obviously there is something more. Are the WITHstatements ok or do they need to be changed ?Dim iMsgDim iConfDim FldsDim strHTMLConst cdoSendUsingPickup = 1set iMsg = Server.CreateObject("CDO.Message")set iConf = Server.CreateObject("CDO.Configuration")Set Flds = iConf.FieldsWith 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".UpdateEnd 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 iBPWith iMsgSet .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").SendEnd With'' Clean up variables.Set iBP = NothingSet iMsg = NothingSet iConf = NothingSet 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 messagenews:%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 messagenews: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 pickupdirectory '' 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吗? 或者这个脚本中还有其他问题吗? 谢谢, FoxHi,I am already past the suggestions on that page.My error configuration is what it needs to be toshow details in the server and in IE..What I really need is for someoneto take a look to see why the templateworks in VBS and not in ASP?.The only thing I can come up with ispossibly the command "WITH".Not knowing as much as many of you, I do notknow if "WITH" works in an ASP page as it does inthe VBS or does that need to be converted for ASP ?Or is there another problem in this script?thanks,Fox 这篇关于ASP中的VBS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-04 18:23