2009-08-05 5 views
2

내 ASP, 기존 ASP 응용 프로그램에서 Windows 2008 Server에 심각한 오류가 발생했습니다. 그것은 Windows 2003 서버에서 잘 작동합니다. 오류는 500 내부 서버 오류입니다. Windows 2008에서 CDO가 작동하지 않습니까?Windows 2008 Server의 ASP 응용 프로그램에서 전자 메일을 보내는 방법

EDIT 오류는 다음과 같습니다. 전송이 서버에 연결하지 못했습니다.

function SendMail(mailFrom, mailTo, mailSubject, mailBody, bHtml) 
Const cdoSendUsingMethod  = _ 
"http://schemas.microsoft.com/cdo/configuration/sendusing" 
Const cdoSendUsingPort   = 2 
Const cdoSMTPServer    = _ 
"http://schemas.microsoft.com/cdo/configuration/smtpserver" 
Const cdoSMTPServerPort   = _ 
"http://schemas.microsoft.com/cdo/configuration/smtpserverport" 
Const cdoSMTPConnectionTimeout = _ 
"http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout" 
Const cdoSMTPAuthenticate  = _ 
"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" 
Const cdoBasic     = 1 
Const cdoSendUserName   = _ 
"http://schemas.microsoft.com/cdo/configuration/sendusername" 
Const cdoSendPassword   = _ 
"http://schemas.microsoft.com/cdo/configuration/sendpassword" 
Const smtpServer = "localhost" 

Dim objConfig ' As CDO.Configuration 
Dim objMessage ' As CDO.Message 
Dim Fields  ' As ADODB.Fields 

' Get a handle on the config object and it's fields 
Set objConfig = Server.CreateObject("CDO.Configuration") 
Set Fields = objConfig.Fields 

' Set config fields we care about 
With Fields 
.Item(cdoSendUsingMethod)  = cdoSendUsingPort 
.Item(cdoSMTPServer)   = smtpServer 
.Item(cdoSMTPServerPort)  = 25 
.Item(cdoSMTPConnectionTimeout) = 10 
.Item(cdoSMTPAuthenticate)  = cdoBasic 
.Item(cdoSendUserName)   = "username" 
.Item(cdoSendPassword)   = "password" 

.Update 
End With 

Set objMessage = Server.CreateObject("CDO.Message") 

Set objMessage.Configuration = objConfig 

With objMessage 
.To  = mailTo 
.From  = mailFrom 
.Subject = mailSubject 
if bHtml then 
.HtmlBody = mailBody 
else  
.TextBody = mailBody 
end if 
.Send 
End With 

Set Fields = Nothing 
Set objMessage = Nothing 
Set objConfig = Nothing 

end function 
+0

ASP 응용 프로그램 Windows 2008 서버에서 보내는 전자 메일에는 어떤 옵션이 있습니까? – Picflight

답변

5

CDO/MAPI 라이브러리를 윈도우 2008에서 기본적으로 설치되지 않은 것으로 나타납니다 : 당신은 download them from Microsoft

여기 내 메일 기능입니다.

당신이 사용 MAPI 또는 CDO (예를 들어, 웹 서버) 및 를 설치하지 않은 컴퓨터에서 실행하는 클라이언트에게 응용 프로그램을 작성하려는 경우 (또는 :

from this blogpost을 참조 된 설치할 수 없다면 Outlook 클라이언트 또는 Exchange 관리 도구 중 하나를 사용하면 MAPI/CDO 라이브러리를 설치해야합니다.

+0

링크가 깨져서 여기에 새 링크가 있습니다 : http://www.microsoft.com/en-us/download/details.aspx?id=1004 – stare

+0

결코 그 조언을 주셔서 감사합니다! – stare

관련 문제