有谁有电子邮件的ASP代码的或有关纲址,贴出来,本人有分给,谢了!

ezhs3809635 2002-03-27 11:16:47
有谁有电子邮件的ASP代码的或有关纲址,贴出来,本人有分给,谢了!
...全文
592 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
coffee_cn 2002-05-17
  • 打赏
  • 举报
回复
Sending HTML with CDO
By Alan Saldanha
Introduction
IIS 4.0 provides an interface to send e-mail via SMTP or the Exchange Server. This interface is called CDO and can be used from an Active Server Page. In March, we published an article by Jon Whiting that outlines the basics of sending e-mail with CDO, entitled: "Collaboration Data Object and IIS 4.0".
In addition to sending plain text mail, you can use the CDO object to send MIME HTML messages and attachments using the AttachURL method. Using AttachURL, you can send e-mail that looks, in Outlook Express, like Figure 1.

Figure 1 : MIME HTML E-mail in Outlook Express
Click Here to View Figure

When you click on "Apr 8, 1998 - New Vendor Site", Internet Explorer will open and navigate to the page indicated in the link. Figure 2 shows the browser after following the link from Figure 1.

Figure 2 : Internet Explorer
Click Here to View Figure

Sending HTML E-mail
The following snippet of script was used to send the e-mail message in Figure 1.


<%
Dim myMail
Set myMail = CreateObject("CDONTS.NewMail")
myMail.AttachURL "c:\images\logo.gif", "logo.gif"
myMail.AttachURL "c:\images\new.gif", "new.gif"

HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & NL
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=""Content-Type"""
HTML = HTML & "content=""text/html; charset=iso-8859-1"">"
HTML = HTML & "<title>15 Seconds</title>"
HTML = HTML & "</head>"
HTML = HTML & "<body bgcolor=""#FFFFFF"">"
HTML = HTML & "<p><font face=""Arial Black""><strong>"
HTML = HTML & "<img src=logo.gif><br>"
HTML = HTML & "<img src=new.gif>"
HTML = HTML & "<a href=http://vendors.15seconds.com>"
HTML = HTML & "Apr 8, 1998 - New Vendor Site</a>"
HTML = HTML & "</strong></font></p>"
HTML = HTML & "<p>15 Seconds is proud to announce a new site"
HTML = HTML & "dedicated to component vendors. The 15 Seconds'"
HTML = HTML & "Vendor Site will help vendors, design, develop and"
HTML = HTML & "marketing their Active Server components. The"
HTML = HTML & "premier article for the new vendor site is entitled:"
HTML = HTML & """Twelve Steps to Becoming a Component Vendor."""

HTML = HTML & "</body>"
HTML = HTML & "</html>"

myMail.From = "alan@vallin.com"
myMail.To = "alan@vallin.com"
myMail.Subject = "15 Seconds Update"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = HTML
myMail.Send
%>



Using Images
A directory was used to hold the images. In the script, the directory images (c:\images) was used to store the images (logo.gif and new.gif). You must know the physical path of the images on the web server. When the e-mail is sent, the images are also sent with the e-mail.
To attach the images in the e-mail you need use the AttachURL method of the CDO object. The actual path of an image was referenced in the AttachURL method. For example in:



myMail.AttachURL "c:\images\logo.gif", "logo.gif"


logo.gif refers to the image at c:\images\logo.gif. The alias, in this case 搇ogo.gif? is used throughout the rest of the HTML page as illustrated by:


HTML = HTML & "<img src=logo.gif><br>"



Including HTML
The body of an e-mail message can contain either plain text or HTML. The BodyFormat property specifies whether or not any HTML is included. If BodyFormat is set to 0, the Body property of the CDO object can include HTML. If set to 1, it can contain only plain text. In the script, the BodyFormat is set to 0:


myMail.BodyFormat = 0


An e-mail message can be plain text or in MIME format. The MailFormat property needs to be set to 0 for MIME format or 1 for plain text. In the script, the MailFormat is set to 0:


MyMail.MailFormat = 0



Conclusion
It is important to understand that not all e-mail clients display HTML e-mail messages. The HTML e-mail works just great with Microsoft抯 Outlook Express. However, the images were not displayed when the e-mail was read using Netscape抯 Communicator.
The CDO object has a lot to offer if you are looking to develop HTML-based e-mail. Combined with javascript:if(confirm('http://www.serverobjects.com/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.serverobjects.com/'" tppabs="http://www.serverobjects.com/">Server Object抯 ASPImage and ASPChart you could send customized e-mail with personalized graphics to every subscriber to your Web site or every employee, in the case of an intranet.

Additional Resources
Collaboration Data Object and IIS 4.0
Additional Articles by Alan
ASP On Speed
How To Track User Activity At A Web Site Using ASP
ASP 101 ?A Database Interfacing Primer





Copyright 1999-2000 internet.com Corp. All RIGHTS RESERVED.

zincoh 2002-03-29
  • 打赏
  • 举报
回复
MSDN搜索CDO FOR NTS
playking 2002-03-29
  • 打赏
  • 举报
回复
http://www.aspfaq.com/email.asp
xjd5555 2002-03-29
  • 打赏
  • 举报
回复
http://www.dldldl.com/download
jinxinjx 2002-03-28
  • 打赏
  • 举报
回复
如何利用ASP实现邮箱访问

http://www.6to23.com/s11/s11d2/2002225155336.htm
香辣五花肉 2002-03-27
  • 打赏
  • 举报
回复
function sendmail(mailfrom,mailto,mailcc,mailsubject,mailbody)
sendmail=false
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.ServerAddress = "192.168.6.103:25"
mailcc=trim(mailcc)
JMail.Sender = mailfrom
JMail.Subject = mailsubject
JMail.AddRecipient mailto
if mailcc<>"" then
AddRecipientCC mailcc
end if
JMail.Body = mailbody
JMail.Priority = 3
JMail.Charset = "gb2312"
JMail.ISOEncodeHeaders = false
JMail.ContentTransferEncoding = "base64"
JMail.Execute
sendmail=true
end function
香辣五花肉 2002-03-27
  • 打赏
  • 举报
回复
function sendmail(mailfrom,mailto,mailcc,mailsubject,mailbody)
sendmail=false
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.ServerAddress = "192.168.6.103:25"
mailcc=trim(mailcc)
JMail.Sender = mailfrom
JMail.Subject = mailsubject
JMail.AddRecipient mailto
if mailcc<>"" then
AddRecipientCC mailcc
end if
JMail.Body = mailbody
JMail.Priority = 3
JMail.Charset = "gb2312"
JMail.ISOEncodeHeaders = false
JMail.ContentTransferEncoding = "base64"
JMail.Execute
sendmail=true
end function
jamex 2002-03-27
  • 打赏
  • 举报
回复
给你个通用函数
sub SendMail(fromWho,toWho,Subject,Body)
dim myMail
SET myMail=server.CreateObject ("CDONTS.Newmail")
with myMail
.MailFormat =0
.BodyFormat =0
.From =fromWho
.To =toWho
.Subject =Subject
.Body =Body
.Send
end with

set myMail=nothing

end sub
香辣五花肉 2002-03-27
  • 打赏
  • 举报
回复
去download一个jmail,安装好以后有帮助文档,里面有详细的使用方法,以及jmail对象每个属性和方法的说明。
jinhaiou 2002-03-27
  • 打赏
  • 举报
回复
www.asp300.com download.有jmail
ksy 2002-03-27
  • 打赏
  • 举报
回复
<%
dim objMail
set objMail=server.CreateObject("Cdonts.NewMail")
objMail.From="kingshang@hotmail.com"
objMail.To="youname@hotmail.com"
objMail.Subject="test Mail"
objMail.Body="Hello,This is just a test Mail."
objMail.Send
Response.Write("Mail has been sent.")
%>
ASP.NET开发典型模块大全(修订版)》以关键技术和热点技术为核心,通过27个典型模块和5章热点技术,全面地介绍了如何使用asp.net进行各领域的web项目开发。全书共3篇分为32章,第1篇关键模块篇,覆盖网站开发的关键领域,内容涉及论坛、博客、播客、网络硬盘、电子邮件、在线考试、网站备忘录、在线短消息、网站访问量统计与分析、系统后台管理权限分配等网站关键模块;第2篇常见模块篇,覆盖网站开发的各个领域,内容涉及网站会员注册及登录、会员密码找回、留言本、上传与下载、图片资源管理、搜索引擎、网上问卷调查、rss在线订阅、聊天室、购物车、在线银行支付、手机短消息管理、在线音乐、投票系统、万能打印、数据自动备份与恢复等常见模块;第3篇热点技术应用篇,解决网站开发在某个领域遇到的技术难题,内容涉及linq数据访问技术、安全技术、服务技术、ajax、高级应用技术等。 《ASP.NET开发典型模块大全(修订版)》附有配套光盘。光盘提供了书中所有案例的全部源代码,并经过精心调试,在windows xp和windows 2000下全部通过,保证能够正常运行。此外,光盘中还提供有编程词典试用版软件。 《ASP.NET开发典型模块大全(修订版)》案例涉及领域广泛,实用性非常强。学习本书读者可以了解各个领域的特点,能够针对某一行业进行软件开发,也可以通过光盘中提供的模块源代码进行二次开发,以减少开发系统所需要的时间。本书适合各级软件开发人员学习使用,也可供大、中专院校师生学习参考。

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧