Asp classic 我的经典ASP脚本包含需要32位启用和禁用应用程序池的两行代码
我从数据库中收集邮件地址,并使用旧的经典ASP发送邮件。JMail要求在应用程序池中禁用32位模式Asp classic 我的经典ASP脚本包含需要32位启用和禁用应用程序池的两行代码,asp-classic,Asp Classic,我从数据库中收集邮件地址,并使用旧的经典ASP发送邮件。JMail要求在应用程序池中禁用32位模式 Set sender = Server.CreateOBject("JMail.Message") 最近,我添加了Oracle DB以收集更多邮件地址,并注意到下面的代码需要启用32位模式的应用程序池: Set conn = Server.CreateObject("ADODB.Connection") conn.Open "Provider=OraOLEDB.Oracle;Data S
Set sender = Server.CreateOBject("JMail.Message")
最近,我添加了Oracle DB以收集更多邮件地址,并注意到下面的代码需要启用32位模式的应用程序池:
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.35.200)(PORT=1521)))(CONNECT_DATA=(SID=MYDB)(SERVER=DEDICATED)));User Id=MYNAME;Password=MyPass;"
这看起来像是一个奇怪的两难境地。在我的情况下,解决方法/解决方案是什么?我将更改为一个ASP电子邮件组件,该组件没有冲突的需求。就我个人而言,我用过ASPEmail。这是一个很好的例子。几年后,我学得很好并使用了CDO。这是我的密码:
<%
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).
Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM
dim objEmail
Set objEmail = CreateObject("CDO.Message")
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")= cdoSendUsingPort
'Name or IP of remote SMTP server
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.domain.com"
'Server port
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpAuthenticate") = cdoBasic
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "info@domain.com"
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "thepassword"
objEmail.BodyPart.Charset = "Windows-1254"
'objEmail.TextBodyPart.Charset = "utf-8"
'objEmail.HTMLBodyPart.Charset = "utf-8"
'objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/SaveSentItems") = TRUE
objEmail.Configuration.Fields.Update
objEmail.From = "My Name <myname@domain.com>"
objEmail.To = "The Name <name@targetmail.com>"
objEmail.Subject = "CDO Test"
objEmail.Textbody = "This is a message."
objEmail.HTMLBody = "<h1>This is a message.</h1>"
objEmail.Send
Response.Write "OK"
%>
Charset和SMTP身份验证功能需要高级版本,其中一个价格为220美元。或者只使用Windows server附带的CDO,您不需要第三方组件。我个人从未发现我需要使用第三方电子邮件组件。正如@John推荐的那样,CDO总是足够了。CDO真是太棒了。。。我的环境在不支持CDO的较新服务器上承载旧版ASP应用程序。CDO是否已停止?您使用的是什么版本的Windows Server?您不能安装64位的Oracle OLEDB提供程序吗?连接必须为32位的唯一原因是该提供程序未在64位注册表中注册。安装Oracle很麻烦,因此我已更换了电子邮件组件。