3、Cdonts程式範例

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5"> <title>LD</title> </head>
<body>
<%
dim strHTML_Body
strHTML_Body = ""
strHTML_Body = "<html><head></head><body>"
strHTML_Body = strHTML_Body &
"==============================================================<BR>"
strHTML_Body = strHTML_Body & "這是一封由CDONTS物件寄出的測試信件
test<BR>"
strHTML_Body = strHTML_Body &
"==============================================================<BR>"
strHTML_Body = strHTML_Body & "</body></html>"

Set ObjSendMail=server.CreateObject("CDONTS.NewMail")
ObjSendMail.BodyFormat=0
ObjSendMail.MailFormat=0

ObjSendMail.From = "寄件者email" '寄信者信箱
ObjSendMail.to = "收件者email" '收信者信箱

ObjSendMail.subject = "CDONTS寄信測試"
ObjSendMail.body = strHTML_Body
ObjSendMail.Send
Set ObjSendMail=Nothing
%>
<script language="javascript">
alert(" 信件已經寄出!");
</script>
</body>
</html>

 
 
捕夢網數位科技有限公司 版權所有 Copyright© 2003-2014 Pumo All Rights Reserved
24小時客服專線:02-8226-9123 / 傳真電話:02-8226-9122  客服信箱:service@pumo.com.tw