[英]How can I create ASP class with “To” property (like CDONTS.NewMail)?
[英]Microsoft VBScript runtime error: Permission denied: 'CreateObject' when creating CDONTS.NEWMAIL
我正在更改以經典ASP編寫的網站。
我的系統是Windows 7 64位。
將其設置為在IIS6上運行的經典asp之后,我已經能夠運行該網站。
當它嘗試執行以下代碼時,出現權限拒絕錯誤:
from1 = "Kevin@company.com"
to1 = "staff1@company.com"
to2 = "staff2@company.net"
to3 = "staff3@client.com"
strTo = to1
If Len(strTo) > 0 Then
If Len(to2) > 0 Then
strTo = strTo & ";" & to2
End If
Else
strTo = to2
End If
If Len(strTo) > 0 Then
If Len(to3) > 0 Then
strTo = strTo & ";" & to3
End If
Else
strTo = to3
End If
body = reqApprName & "<br />" & reqApprPhone & "<br />" & reqApprEmail & "<br />Loan Number: "_
& loannum & "<br /><br />Please do not reply back to this email. The Vendor has provided the following "_
& "comment associated with this order.<br /><br />" & reqUndueInfluenceComment
Set ObjMail = CreateObject("CDONTS.Newmail")
ObjMail.From = from1
ObjMail.To = strTo
ObjMail.Subject = "Appraisal Order "&OrderNum&" by Vendor"
ObjMail.BodyFormat = 0
ObjMail.MailFormat = 0
ObjMail.Body = body
ObjMail.Send
Set ObjMail = Nothing
我很困惑,因為我以前從未遇到過CDONTS問題。 再說一次,我從未嘗試過在Windows 7 64位計算機上使用32位經典ASP來使用它。
有人有什么想法嗎?
謝謝大家
PS:我在CDONTS.NewMail的創建對象上收到錯誤
當您嘗試發送一條消息時,您可能會收到以下錯誤消息:
Microsoft VBScript runtime error '800a0046' Permission denied
當應用程序在IIS中進程外運行時,會發生此問題。
發生此問題時,該進程的用戶上下文將從無法訪問IIS元數據庫的IUSR_MachineName帳戶更改為無法訪問IIS元數據庫的IWAM_MachineName帳戶。
通常,此錯誤有兩個原因。
運行.asp頁或運行腳本的用戶沒有對分揀目錄的權限。
通常,分揀目錄位於以下位置:
對於僅運行IIS的計算機:C:\\ Inetpub \\ Mailroot \\ Pickup
對於運行Microsoft Exchange 5.5的計算機:Exchsrvr \\ Mailroot \\ Pickup
對於運行Exchange 2000的計算機:\\ Program Files \\ Exchsrvr \\ Mailroot \\ Vsi#\\ Pickup
解
The user under whom the .asp page is running or the script is running must have Modify (Change) permission to the Pickup directory so that the NewMail object can create the .eml file.
該頁面在其自己的內存空間中運行,並且被拒絕訪問IIS元數據庫。 要驗證此,請按照下列步驟操作:
單擊開始,單擊運行,鍵入Inetmgr,然后單擊確定。
用鼠標右鍵單擊包含您的頁面的根目錄或虛擬目錄,然后單擊屬性。
如果在步驟2中右鍵單擊根目錄,請單擊“主目錄”選項卡。
如果在步驟2中右鍵單擊虛擬目錄,請單擊“虛擬目錄”選項卡。
在運行Windows NT的計算機上,確定是否選中了“在單獨的內存空間中運行”復選框。
如果選中在單獨的內存空間中運行復選框,請單擊以清除該復選框。 或者,在SMTP服務的“屬性”菜單上,單擊“操作員”選項卡,然后添加IWAM_MachineName帳戶。
在運行Windows 2000的計算機上,確定“應用程序保護”設置是否設置為“高(隔離)”。 如果“應用程序保護”設置設置為“高(隔離)”,則將“應用程序保護”設置設置為“中(池)”。 或者,在SMTP服務的“屬性”菜單上,單擊“安全性”選項卡,然后將IWAM_MachineName帳戶添加到“操作員”帳戶。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.