티스토리 뷰

💼 정보 ver1.0

인증을 통한 메일발송

James Wetzel 2010. 10. 27. 17:42


<%
Const cdoSendUsingMethod ="http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort = 2
Const cdoSMTPServer ="http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort ="http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout ="http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAccountName ="http://schemas.microsoft.com/cdo/configuration/smtpaccountname"
Const cdoSMTPAuthenticate ="http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic = 1
Const cdoSendUserName ="http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword ="http://schemas.microsoft.com/cdo/configuration/sendpassword"

Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields

' Get a handle on the config object and it's fields
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields

' Set config fields we care about
With Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "mail2.10dr.com"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "아이디"
.Item(cdoSendPassword) = "비밀번호"
.Update
End With

Dim mailContent
 mailContent ="<table width='600px' align='left' cellpadding='10px' bgcolor='#F5FAFA' cellspacing='0' style='font-size:14px;' border='1' bordercolor='#CCE3E3' >" & _
     "<tr height='60'>" & _
      "<td colspan='2' bgcolor='#CCE3E3' style='color:#427979' align='center' ><strong>사업제휴 제안</strong></td>" & _
     "</tr>" & _
     "<tr height='40'>" & _
      "<td style='font-size:12px' width='78'>회사명</td>" & _
      "<td style='font-size:12px' width='380'>"& Request("company") &"</td>" & _
     "</tr>" & _
     
     "<tr height='40'>" & _
      "<td style='font-size:12px'>담당자</td>" & _
      "<td style='font-size:12px'>"& Request("person") &"</td>" & _
     "</tr>" & _
     
     "<tr height='40'>" & _
      "<td style='font-size:12px'>e-mail</td>" & _
      "<td style='font-size:12px'>"& Request("email") &"</td>" & _
     "</tr>" & _
     
     "<tr height='40'>" & _
      "<td style='font-size:12px'>연락처</td>" & _
      "<td style='font-size:12px'>"& Request("phone") &"</td>" & _
     "</tr>" & _
     
     "<tr height='40'>" & _
      "<td style='font-size:12px'>제목</td>" & _
      "<td style='font-size:12px'>"& Request("title") &"</td>" & _
     "</tr>" & _
     
     "<tr height='40'>" & _
      "<td style='font-size:12px'>내용</td>" & _
      "<td style='font-size:12px'>"& Replace(Request("contnets"), vblf, vblf & "<br/>") &"</td>" & _
     "</tr>" & _
    "</table>"

Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig

With objMessage
.To = "jjh5400823@10dr.com"
.From = Request("email")
.Subject = "10DR 제휴문의 메일입니다."
.HTMLBody = mailContent
.Send
End With

Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing


Response.Write "<script>location.href='/default.asp';alert('10DR 사이트에 제휴요청을 하였습니다.\n빠른 시일내에 연락 드리겠습니다.\n감사합니다.');</script>"
%>

728x90
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함