CDO.Message 를 이용한 웹메일 보내기 > 소스코드

본문 바로가기
사이트 내 전체검색


회원로그인

소스코드

asp | CDO.Message 를 이용한 웹메일 보내기

페이지 정보

작성자 100K5 작성일14-05-21 19:13 조회59,687회 댓글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
 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
 objMail.Subject = subject
 objMail.HTMLBody = content
 
 strFilePath = "file://" & attach_file
 set atc = objMail.AddAttachment(strFilePath)
 atc.ContentMediaType = "application/octet-stream"
 objMail.BodyPart.Charset="utf-8"
 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)
 
 

댓글목록

등록된 댓글이 없습니다.


사이트소개 개인정보취급방침 서비스이용약관 Copyright © kkujunhee.net All rights reserved.
상단으로

개인정보관리책임자 : 관리자

모바일 버전으로 보기