프로그래밍/ASP

asp mail cdo.message 카페24서버 발송

p-a-r-k 2016. 9. 30. 10:27
반응형

cafe24 메일서버전용 함수

<%
	sSetTitle = "[제목] ㅇㅇㅇ님이 보내신 메일입니다."
	sToAddr = "admin@naver.com"
	sSetMsg = "

내용 : blah

" Function mailsend(subject,bcc,admin,email,body) 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 iConf Set iConf = CreateObject("CDO.Configuration") iConf.Load 1 Dim Flds Set Flds = iConf.Fields With Flds .Item(cdoSendUsingMethod) = cdoSendUsingPort .Item(cdoSMTPServer) = "mw-002.cafe24.com" .Item(cdoSMTPServerPort) = 25 .Item(cdoSMTPAuthenticate) = cdoBasic .Item(cdoSendUserName) = "cafe24 entry mail" .Item(cdoSendPassword) = "cafe24 pwd" .Update End With ' 메일 전송 컴포넌트에 필요 정보 입력 Set objMail = Server.CreateObject("CDO.Message") objMail.Configuration = iConf objMail.From = admin '보내는사람 이메일 objMail.To = email '받는사람 이메일 objMail.Bcc = bcc '숨은 참조 Bcc objMail.Subject = subject '제목 objMail.HTMLBody = body '내용 objMail.Send Set objMail = Nothing Set iConf = Nothing End Function Call mailsend(sSetTitle, "", sGetEmail, sToAddr, sSetMsg) %>
반응형