달력

42025  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
반응형

<%
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 친절한 웬디양~ㅎㅎ
|