Latest web development tutorials

ASP는 전자 메일을 보낼 CDOSYS 사용

CDOSYS는 ASP의 기본 구성 요소입니다. 이 구성 요소는 ASP를 통해 전자 메일을 전송하는 데 사용됩니다.


전자 메일을 보낼 CDOSYS를 사용

CDO (공동 작업 데이터 개체)는 통신 애플리케이션의 생성을 간소화하기 위해 설계된 마이크로 소프트 기술이다.

CDOSYS는 ASP의 기본 구성 요소입니다. 우리는 어떻게 이메일을 보내도록 구성 요소 ASP를 사용하는 방법을 보여 드리겠습니다.

CDONTS 방법?

마이크로 소프트는 윈도우 2000, 윈도우 XP 및 Windows 2003 제거 CDONTS 있습니다. 이미 CDONTS에게 당신의 ASP 응용 프로그램을 사용하는 경우, 당신은 당신의 코드를 업데이트하고, 새로운 CDO 기술을 사용해야합니다.

CDOSYS의 예

전자 메일 텍스트를 보내기 :

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="[email protected]"
myMail.To="[email protected]"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>

숨은 및 CC 필드 텍스트 이메일 보내기 :

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="[email protected]"
myMail.To="[email protected]"
myMail.Bcc="[email protected]"
myMail.Cc="[email protected]"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>

HTML 전자 메일 보내기 :

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="[email protected]"
myMail.To="[email protected]"
myMail.HTMLBody = "<h1>This is a message.</h1>"
myMail.Send
set myMail=nothing
%>

사이트의 HTML 전자 메일의 페이지의 내용을 보내기 :

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="[email protected]"
myMail.To="[email protected]"
myMail.CreateMHTMLBody "http://www.w3cschool.cc/asp/"
myMail.Send
set myMail=nothing
%>

HTML 전자 메일에 파일로 컴퓨터에 페이지의 콘텐츠를 보내기 :

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="[email protected]"
myMail.To="[email protected]"
myMail.CreateMHTMLBody "file://c:/mydocuments/test.htm"
myMail.Send
set myMail=nothing
%>

첨부 파일과 텍스트 이메일 보내기 :

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="[email protected]"
myMail.To="[email protected]"
myMail.TextBody="This is a message."
myMail.AddAttachment "c:mydocumentstest.txt"
myMail.Send
set myMail=nothing
%>

전자 메일의 본문을 전송하도록 원격 서버를 사용하여

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="[email protected]"
myMail.To="[email protected]"
myMail.TextBody="This is a message."
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.server.com"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
%>