Set ObjMail = Server.CreateObject("CDO.Message") Set ObjConf = Server.CreateObject("CDO.Configuration")
Set Flds = ObjConf.Fields ''1:local SMTP로 발송(pickup directory), 2:원격지 SMTP로 발송 Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.domain.com" '' 도메인 or IP Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 '' 원격지 SMTP Port 번호 Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username" '' 원격지 SMTP에 인증이 있을경우 계정 Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "passwd" '' 원격지 SMTP에 인증이 있을경우 비밀번호 Flds.Update Set ObjMail.Configuration = ObjConf
ObjMail.Subject = ''메일제목 ObjMail.From = '' 보내는사람 (형식 : 표시할이름<메일주소>) ObjMail.To = '' 받는사람 ObjMail.TextBody = '' 텍스트 메일 내용 ObjMail.DSNOptions = 14 '' 이 메시지의 배달 상태 확인(delivery status notification:DSN)값으로 14는 배달 성공, 실패 및 지연시 확인메시지 생성 '' 0 : 확인메세지 생성 안함 '' 1 : 확인메세지 생성 안함 '' 2 : 배달 실패시 확인메시지 생성 '' 4 : 배달 성공시 확인메시지 생성 '' 8 : 배달 지연시 확인메시지 생성 ''14 : 배달 성공, 실패 및 지연시 확인메시지 생성 ObjMail.Fields("urn:schemas:mailheader:return-receipt-to") = "시세상<mail@mail.com>" '' 받는 사람이 이 메시지를 열었을 때 읽음 확인 메시지가 여기에서 지정된 사람에게 보내집니다. ObjMail.Send Set ObjMail = Nothing