CDO.Message 와 CDONTS.NewMail 의 차이점은
cdonts 는 NT 에 제공된 메일 컴포넌트 이며 2000서버부터 CDO가 제공되었습니다.
물론 2000에서는 호환성 때문인지는 모르지만 cdonts도 같이 제공되었구요.
XP Pro / 2003 서버에서는 더이상 cdonts는 제공되지 않습니다.
참고로 CDONTS 객체는 원격접속과 SMTP 인증기능이 없으므로 위와 같이 CDO 로 구현하셔야 합니다.
- 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 cdoSMTPAccountName = _
- "http://schemas.microsoft.com/cdo/configuration/smtpaccountname"
- 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"
- 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) = "메일서버주소"
- .Item(cdoSMTPServerPort) = 25
- .Item(cdoSMTPAuthenticate) = cdoBasic
- .Item(cdoSendUserName) = "POP메일아이디@POP메일도메인"
- .Item(cdoSendPassword) = "POP메일비밀번호"
- .Update
- End With
- Set objMessage = Server.CreateObject("CDO.Message")
- Set objMessage.Configuration = objConfig
- With objMessage
- .To = "batman@gotham.com"
- .From = "superman@crypton.net"
- .Subject = "Hello, this is test mail"
- .HTMLBody = "Hello"
- .Send
- End With
- Response.Write "Success"
- Set Fields = Nothing
- Set objMessage = Nothing
- Set objConfig = Nothing
.
'Computer > ASP' 카테고리의 다른 글
펌) dext업로드 컴포넌트에 대해서.. (0) | 2011.11.29 |
---|---|
펌) asp에서 디비작업 최적화하기 (0) | 2011.11.29 |
ASP CDONTS 메일 발송 (0) | 2011.11.29 |
CDO 객체를 이용한 메일발송 ASP 예제 (0) | 2011.11.29 |
asp 용 substring. (0) | 2008.01.11 |