asp 의 CDO.Message 객체를 이용하여 메일 발송
카페24에 올라와있는 소스임 ㅋ.
카페24에 asp 작업을 하는데 SMTP 발송이 안됨.
25번 포트도 안 열려있고, FAQ 뒤지다보니
메일 발송 서버는 외부 서버임 ㅠ.ㅠ
젠장.
Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"
카페24에 올라와있는 소스임 ㅋ.
카페24에 asp 작업을 하는데 SMTP 발송이 안됨.
25번 포트도 안 열려있고, FAQ 뒤지다보니
메일 발송 서버는 외부 서버임 ㅠ.ㅠ
젠장.
Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort = 2 ' 1 로컬 SMTP, 2 외부 SMTP
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) = "smtp 서버"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "SMTP 인증 아이디@메일주소"
.Item(cdoSendPassword) = "SMTP 인증 비번"
.Update
End With
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
With objMessage
.BodyPart.Charset = "ks_c_5601-1987" ' 한글이 깨지면 이렇게 설정
.To = "받는넘메일"
.From = "보내는넘 메일"
.Subject = "제목"
.HTMLBody = "본문"
.HTMLBodyPart.Charset = "ks_c_5601-1987" ' 본문 한글이 깨지면 캐릭터셋 설정
.Send
End With
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
.'Computer' 카테고리의 다른 글
아이폰5 충전단자 교체 (0) | 2018.01.29 |
---|---|
도메인 기관이전 godaddy -> namecheap (0) | 2016.05.17 |
크롬 버전 40.0.2214.91 https 연결시 경고창 표시 (0) | 2015.01.24 |