13. 5. 21.

Classic ASP Email 전송

<%
    
' Mail 발송
Function eMailCDOSend(MailTitle, MailTag, Sender, Receiver) 
 ' MailTitle : 제목
 ' MailTag : html내용
 ' Sender : 보내는 사람
 ' Receiver : 받는사람
 ' 2008서버 이상 에서 발송하는 환경정보 설정
 Dim eMailObject, eMailConfig
 Set eMailObject = Server.CreateObject("CDO.Message")
 Set eMailConfig = Server.CreateObject("CDO.Configuration")
 Dim SchemaPath : SchemaPath = "http://schemas.microsoft.com/cdo/configuration/"
 With eMailConfig.Fields
  .Item (SchemaPath & "sendusing") = 2  'CDOSendUsingPort
  .Item (SchemaPath & "smtpserver") = "127.0.0.1"  'CDOSendUsingPort [ServerIP]
  .Item (SchemaPath & "smtpserver") = "localhost"    'CDOSendUsingPort
  .Item (SchemaPath & "smtpserverport") = "25"  'Port
  .Update
 End With
 eMailObject.Configuration = eMailConfig
 Set eMailConfig = Nothing
 With eMailObject
  .From = Sender
  .To = Receiver
  .Subject = MailTitle
  .HTMLBody = MailTag
'  .HTMLBodyPart.Charset = "Utf-8"
  .Send
 End With
 Set eMailObject = Nothing
End Function


%>

댓글 없음:

댓글 쓰기