태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.

티스토리 툴바


'일or놀이/ASP'에 해당되는 글 1건

  1. 2006/01/03 CDO.Message 를 이용한 이메일 발송

CDO.Message 를 이용한 이메일 발송

<%
Function sendMail(strTo, strFrom, strSubject, strBody)
On Error Resume Next

Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

 Flds("
http://schemas.microsoft.com/cdo/configuration/smtpserver")               = "mail.xxxx.com"          ' 메일서버 IP
 Flds("
http://schemas.microsoft.com/cdo/configuration/smtpserverport")          = 25                               ' 포트번호
 Flds("
http://schemas.microsoft.com/cdo/configuration/sendusing")                = 2                                 ' cdoSendUsingPort
 Flds("
http://schemas.microsoft.com/cdo/configuration/smtpaccountname")     = "master@xxxx.com"                      ' 계정이름
 Flds("
http://schemas.microsoft.com/cdo/configuration/sendemailaddress")     = """관리자"" <master@xxxx.com>"
 Flds("
http://schemas.microsoft.com/cdo/configuration/smtpuserreplyemailaddress")= """관리자"" <master@xxxx.com>"
 Flds("
http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")       = 1 'cdoBasic
 Flds("
http://schemas.microsoft.com/cdo/configuration/sendusername")          = "master@xxxx.com"            ' 계정ID
 Flds("
http://schemas.microsoft.com/cdo/configuration/sendpassword")          = "xxxx"                         ' 비밀번호
 Flds.Update

Set Flds = Nothing
Set iMsg =  Server.CreateObject("CDO.Message")
With iMsg
 .Configuration = iConf
 .To       = strTo           ' 받는넘
 .From     = strFrom           ' 보내는넘
 .Subject  = strSubject                             ' 제목     
 .HTMLBody = strBody                            ' 내용
 .Send
End With

Set iMsg = Nothing

Set iConf = Nothing
If Err Then
    Response.Clear
    Response.write "Error Number : " & Err.number & "<br>" & _
               "Error Source : " & Err.Source & "<br>" & _
               "Error Descryption : " & Err.Description
    Response.End
Else
    'Response.Write "메일이 정상적으로 발송되었습니다"
End If

End Function
%>

Posted by TIGERJUNE
TAG ,

트랙백 주소 http://tigerjune.tistory.com/trackback/39 관련글 쓰기

댓글을 달아 주세요

이전버튼 1 이전버튼