青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

C++ Programmer's Cookbook

{C++ 基礎(chǔ)} {C++ 高級} {C#界面,C++核心算法} {設(shè)計(jì)模式} {C#基礎(chǔ)}

Sending Email in .NET

Author: James Foster Date Posted: 09/05/2001 .NET Version: 1.0.3705
If you've had to send email with regular ASP, you've probably used CDONTS. In .NET, this functionality has been rolled into the Framework, and is part of the System.Web.Mail namespace. Using the classes in this namespace, you can easily construct and send email, with attachments if you wish, using the SMTP service built into Windows.
System.Web.Mail Namespace
The System.Web.Mail namespace is composed of three classes and three enumerations.

Classes:

MailAttachmentRepresents the attachments of an email.
MailMessageRepresents the email itself.
SmtpMailResponsible for sending MailMessages via SMTP.

Enumerations:

MailEncodingSpecifies the Encoding of the message: Base64 or UUEncode
MailFormatSpecifies the Format of the message: Html or Text
MailPrioritySpecifies the Priority of the message: High, Medium, or Low.
Constructing the MailMessage
The MailMessage object represents an email. You start by instantiating a MailMessage object, and then set the properties with the details of the email. The following properties are the ones you are most likely to use in your application:

Attachmentsthe list of attachments (represented by MailAttachment objects) that are transmitted with the email
Bcca semicolon-delimited list of email addresses that receive a Blind Carbon Copy (BCC) copy of the email message
Bodythe body of the email
BodyFormatspecifies the MailFormat of the email
Cca semicolon-delimited list of email addresses that receive a Carbon Copy (CC) of the email message
Fromthe email address of the sender
Priorityspecifies the MailPriority of the email
Subjectthe subject of the email
Tothe email address of the recipient
UrlContentBasethe URL base of all relative URL's used in an Html Body
UrlContentLocationSpecifies the Priority of the message: High, Medium, or Low.
Sending with SmtpMail
Once you have constructed your MailMessage object, you use another object, SmtpMail, to actually send it. The most important method on the SmtpMail object is a static method, Send. This method has two variants. One allows you to send a MailMessage object:
SmtpMail.Send(myEmailObject);
Another variant allows you to specify the sender, recipient, subject and the body of an email, and have it sent right away.
SmtpMail.Send(strFrom, strTo, strSubject, strBody);
Example
Now let's look at an example that pulls this all together. We'll start by creating a MailMessage object, setting a few properties, and finally sending the email with the SmtpMail object.

<%@ Page Language="C#"%>

<scriptlanguage="C#"runat="server">

void Page_Load()
{
????// CREATE A MAIL MESSAGE
????System.Web.Mail.MailMessage myEmail=new System.Web.Mail.MailMessage();

????// SET MESSAGE PARAMETERS
????myEmail.From ="agent@mypersonalshoppers.com";
????myEmail.To ="john@johnsmith.com";
????myEmail.Subject ="Product Availability Notice";
????myEmail.BodyFormat = System.Web.Mail.MailFormat.Html;
????myEmail.Body ="The sunglasses you expressed interest in are now in stock.";

????//SEND THE MESSAGE
????System.Web.Mail.SmtpMail.Send(myEmail);

????//UPDATE STATUS
????lblMailStatus.Text ="Mail successfully sent.";
}

</script>

<html>
<body>

<asp:Label id="lblMailStatus"runat="server"/>

</body>
</html>

posted on 2006-04-14 12:43 夢在天涯 閱讀(452) 評論(0)  編輯 收藏 引用 所屬分類: C#/.NET

公告

EMail:itech001#126.com

導(dǎo)航

統(tǒng)計(jì)

  • 隨筆 - 461
  • 文章 - 4
  • 評論 - 746
  • 引用 - 0

常用鏈接

隨筆分類

隨筆檔案

收藏夾

Blogs

c#(csharp)

C++(cpp)

Enlish

Forums(bbs)

My self

Often go

Useful Webs

Xml/Uml/html

搜索

  •  

積分與排名

  • 積分 - 1816496
  • 排名 - 5

最新評論

閱讀排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
      <noscript id="pjuwb"></noscript>
            <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
              <dd id="pjuwb"></dd>
              <abbr id="pjuwb"></abbr>
              国产精品免费观看在线| 欧美日韩国产高清| 久久成人免费视频| 麻豆成人在线观看| 欧美一区二区三区免费大片| 国产精品日韩精品欧美在线| 小处雏高清一区二区三区 | 亚洲免费观看在线观看| 亚洲第一精品在线| 欧美成人三级在线| 一区二区成人精品 | 亚洲国产精品久久久久久女王| 久久精品动漫| 亚洲精品欧洲精品| 一区二区高清在线| 国产日韩欧美夫妻视频在线观看| 久久久久久久一区二区| 麻豆精品网站| 亚洲一区二区三区高清不卡| 小黄鸭视频精品导航| 亚洲国产片色| 国内外成人在线视频| 亚洲国产婷婷| 国产精品乱人伦中文| 免费成人在线观看视频| 欧美日韩123| 久久精品99| 欧美国产欧美亚洲国产日韩mv天天看完整 | 免费观看久久久4p| 亚洲一区二区精品| 久久精品最新地址| 一本综合久久| 久久精精品视频| 国产精品99久久久久久久久久久久 | 亚洲欧美国产制服动漫| 久久综合色影院| 亚洲欧美日韩中文在线制服| 久久免费高清| 亚洲欧美99| 欧美电影免费| 久久综合影音| 国产精品一区视频| 亚洲国产成人午夜在线一区| 国产欧美视频一区二区三区| 亚洲日本免费| 亚洲福利一区| 欧美一区二区在线看| 亚洲午夜精品| 欧美国产日韩精品| 玖玖视频精品| 国产亚洲激情| 亚洲欧美激情视频在线观看一区二区三区| 亚洲国产欧美一区二区三区丁香婷| 亚洲自拍三区| 亚洲欧美日本国产有色| 欧美日韩精品欧美日韩精品一| 蜜臀a∨国产成人精品| 国产夜色精品一区二区av| 亚洲天堂黄色| 亚洲欧美久久久| 国产精品av久久久久久麻豆网 | 夜夜精品视频一区二区| 老司机午夜精品| 老巨人导航500精品| 国内精品一区二区| 欧美一区二区免费视频| 久久国产精品99久久久久久老狼| 国产精品国产福利国产秒拍 | 欧美精品免费视频| 欧美成年人视频| 国产欧美日韩免费| 久久久久久久久久久一区 | 一区二区三区四区国产| 免费亚洲电影| 亚洲国产婷婷| 正在播放欧美视频| 国产精品第一区| 亚洲一区欧美| 久久九九久精品国产免费直播| 国产三级欧美三级日产三级99| 亚洲综合首页| 久久亚洲欧美| 亚洲激情一区二区三区| 欧美母乳在线| 亚洲一区二区在线观看视频| 久久精品日韩欧美| 欧美成人资源网| 久久精品国产99国产精品澳门| 欧美国产激情二区三区| 日韩天堂在线视频| 午夜久久99| 在线电影一区| 欧美日韩高清一区| 亚洲伊人伊色伊影伊综合网| 久久精品主播| 亚洲精品久久久久久久久久久| 欧美日韩一区在线| 欧美一级视频精品观看| 亚洲东热激情| 香蕉乱码成人久久天堂爱免费 | 欧美电影免费观看高清| 国产精品99久久久久久白浆小说| 午夜日韩激情| 亚洲人成7777| 国产免费亚洲高清| 欧美成人综合网站| 午夜精品www| 亚洲国产精品一区二区第一页 | 欧美有码在线视频| 国产亚洲精品7777| 免费在线看一区| 亚洲香蕉伊综合在人在线视看| 久久久久久成人| 中文国产成人精品| 精品不卡一区二区三区| 欧美视频一区二区| 免费日韩一区二区| 亚洲免费在线精品一区| 亚洲精品欧美专区| 免费观看不卡av| 欧美在线免费一级片| 99视频日韩| 91久久极品少妇xxxxⅹ软件| 国产九区一区在线| 欧美色视频在线| 欧美国产日韩一区| 久久久人成影片一区二区三区| 亚洲综合日韩| 一区二区毛片| 亚洲精品在线免费| 一区二区三区国产盗摄| 猫咪成人在线观看| 小黄鸭精品密入口导航| 国产精品99久久99久久久二8 | 欧美亚洲日本一区| 亚洲一区二区三区777| 亚洲日韩欧美视频一区| 欧美成人资源网| 久久一区亚洲| 久久精品国产一区二区三区| 欧美亚洲午夜视频在线观看| 亚洲一区二区精品在线观看| 亚洲精品一区二区网址| 最新国产拍偷乱拍精品| 影音先锋久久精品| 亚洲国产精品99久久久久久久久| 激情欧美一区二区三区| 国内精品久久久久久 | 在线视频一区二区| 亚洲自拍偷拍麻豆| 在线日韩av片| 看片网站欧美日韩| 久久免费视频网| 久久久综合网| 久久三级视频| 美乳少妇欧美精品| 欧美/亚洲一区| 欧美全黄视频| 国产精品私房写真福利视频| 国产精品免费观看在线| 国产亚洲精品成人av久久ww| 国产一区二区三区自拍| 国产亚洲精久久久久久| 影音先锋欧美精品| 亚洲免费大片| 亚洲欧美一区在线| 久久久噜噜噜久久中文字幕色伊伊 | 亚洲一区二区精品| 制服丝袜亚洲播放| 香港久久久电影| 久久频这里精品99香蕉| 欧美成人一品| 一本色道久久精品| 欧美一级电影久久| 欧美电影免费网站| 国产精品丝袜xxxxxxx| 在线成人性视频| 亚洲视频你懂的| 久久婷婷国产综合尤物精品| 亚洲激情综合| 午夜精品视频在线| 欧美国产精品中文字幕| 国产精品视频久久一区| 亚洲国产岛国毛片在线| 一区二区日韩伦理片| 久久九九热re6这里有精品| 亚洲国内欧美| 欧美中文字幕不卡| 欧美成人综合一区| 久久精品成人欧美大片古装| 欧美特黄a级高清免费大片a级| 欧美日韩视频一区二区| 黄色一区二区在线| 亚洲欧美日韩国产成人精品影院| 美日韩在线观看| 亚洲一区国产精品| 欧美日韩1区2区| 在线免费观看日本欧美| 欧美一区国产一区| 日韩一级黄色大片|