2003 메일 서버 지정 폼메일

WINDOWS/Mail 2006/08/01 10:04
Dim iMsg
Dim iConf  
Dim Flds

Set  iConf  =  CreateObject("CDO.Configuration")
Set  iMsg  =  CreateObject("CDO.Message")
Set  Flds  =  iConf.Fields

With  Flds
   .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "아이피" '메일서버 지정
   .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 '포트
   .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
   .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\Inetpub\mailroot\Pickup"
   '.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30

'Const cdoSendUsingPort = 1 '1일 경우 로컬(SMTP), 2일 경우 외부(SMTP)로 메일전송


   .Update
End  With

With iMsg
Set .Configuration = iConf
         .To       = "메일주소"
         .From     = "메일주소"
         .Subject  = "메일 제목"
         .HTMLBody = "메일 내용"
         .Send
End With

Set iConf = nothing
Set iMsg = nothing
Set Flds = nothing


Dim iMsg
Dim iConf
Dim Flds
Dim strHTML

Const cdoSendUsingPort = 1
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
Flds.Update

Set iMsg.Configuration = iConf

       
  iMsg.To = tomail
  iMsg.From = formmail
  iMsg.Subject = title
  iMsg.HTMLBody = content
  iMsg.BodyPart.Charset="ks_c_5601-1987"
  iMsg.HTMLBodyPart.Charset="ks_c_5601-1987"
  iMsg.Send
 

Set iMsg = Nothing                
Set iConf = Nothing              
Set Flds = Nothing  
tags :
Comment 0

Write a comment