asp | CDO.Message 를 이용한 웹메일 보내기
페이지 정보
작성자 100K5 작성일14-05-21 19:13 조회59,844회 댓글0건관련링크
본문
' 메일 발송 함수
Sub sendEmail(ByVal subject, ByVal to_mail, ByVal from_mail, ByVal content, ByVal attach_file )
Set objMail = Server.CreateObject("CDO.Message")
objMail.From = from_mail
objMail.To = to_mail
objMail.From = from_mail
objMail.To = to_mail
Set objconf = objMail.Configuration
Set Flds = objconf.Fields
Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\Inetpub\mailroot\Pickup"
Flds.update
Set Flds = objconf.Fields
Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "C:\Inetpub\mailroot\Pickup"
Flds.update
objMail.Subject = subject
objMail.HTMLBody = content
strFilePath = "file://" & attach_file
objMail.HTMLBody = content
strFilePath = "file://" & attach_file
set atc = objMail.AddAttachment(strFilePath)
atc.ContentMediaType = "application/octet-stream"
atc.ContentMediaType = "application/octet-stream"
objMail.BodyPart.Charset="utf-8"
objMail.HTMLBodyPart.Charset="utf-8"
objMail.Send
objMail.HTMLBodyPart.Charset="utf-8"
objMail.Send
Set objMail = Nothing
End Sub
' 메일 발송 함수 호출
' 첨부 파일 저장 위치
attach_file = physical_path & "upload\appendFile\" & up_file_name
Call sendEmail(writer & "님께서 글을 남기셨습니다., to_mail, from_mail, mail_design, attach_file)
댓글목록
등록된 댓글이 없습니다.