我的经典 ASP 脚本包含需要启用和禁用 32 位应用程序池的两行
My Classic ASP script contains both lines that require 32bit enabled and disabled application pools
我从数据库中收集邮件地址并使用旧经典 ASP 发送邮件。 JMail 要求在应用程序池中禁用 32 位模式。
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;"
这看起来像是一个奇怪的困境。在我的情况下 workaround/solution 是什么?
我会更改为 ASP 没有冲突要求的电子邮件组件。就个人而言,我使用过 ASP 电子邮件。距离 google :).
我学得很好,多年后使用了 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"
%>
我从数据库中收集邮件地址并使用旧经典 ASP 发送邮件。 JMail 要求在应用程序池中禁用 32 位模式。
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;"
这看起来像是一个奇怪的困境。在我的情况下 workaround/solution 是什么?
我会更改为 ASP 没有冲突要求的电子邮件组件。就个人而言,我使用过 ASP 电子邮件。距离 google :).
我学得很好,多年后使用了 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"
%>