Live Brilliant

windows 2008 server 메일서버 셋팅 본문

개발은 핵찜이야/WINDOWS

windows 2008 server 메일서버 셋팅

주인정 2012. 4. 17. 15:48

1. SMTP 6.0 설치

- SMTP 설정을 하기 위해서는 우선 아래 그림처럼 IIS 6.0관리자를 설치해야한다.

- [SMTP Virtual Server] 우클릭 > 속성 > 액세스[탭] > 릴레이 제한 > 아래목록을 제외한 모든컴퓨터 체크

2. 메일발송 소스

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

' Setting the SMTP Server
With objConfig.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1 ' 1: 로컬(SMTP), 2 : 외부(SMTP)
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "127.0.0.1"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\Inetpub\mailroot\Pickup" ' Pickup 디렉토리 설정
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30 ' 연결 시간
.Update
End With

With objMessage
.To = strTo
.From = strFrom
.Subject = subject
.HTMLBody = content
.Send
End With

Set objConfig = Nothing
Set objMessage = Nothing

#### Error #####

CDO.Message.1 Access Denied 에러발생시 권한 문제이다.

C:\inetpub\mailroot 권한을 주어야 한다.

mailroot 폴더에 IIS_IUSRS 사용자그룹에 쓰기권한을 부여하자

 

Comments