📄 describeprocd_sendmail.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><!-- InstanceBegin template="/Templates/DWOLTL_contentTemplete.dwt" codeOutsideHTMLIsLocked="false" -->
<HEAD>
<!-- InstanceBeginEditable name="doctitle" -->
<TITLE>描述发送电子邮件的过程</TITLE>
<!-- InstanceEndEditable --><META content="text/html; charset=gb2312" http-equiv=Content-Type>
<STYLE type=text/css>
.text {
FONT: 12px/16px "Arial", "Helvetica", "sans-serif"; TEXT-ALIGN: justify
}
.style4 {
font-size: 12px;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.style6 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
</STYLE>
<META content="MSHTML 5.00.3700.6699" name=GENERATOR>
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
.style10 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
<style type="text/css">
<!--
.style11 {font-style: normal; font-weight: bold; font-variant: normal; text-transform: capitalize; color: #003399; font-family: "Arial", "Helvetica", "sans-serif";}
-->
</style><!-- InstanceEndEditable -->
<link href="frame.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY leftMargin=2 topMargin=2 marginheight="2" marginwidth="2">
<DIV align=center>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 class=bg height=678
id=zz width=760>
<TBODY>
<TR>
<TD align=left class=spline height=437 rowSpan=4 vAlign=top width=47>
<DIV align=center></DIV></TD>
<TD align=left height=40 vAlign=top width=158><B><FONT face=ºÚÌå size=5><A
href="index.htm"><IMG border=0
height=58 src="Images/logo_jb-1.jpg"
width=153></A></FONT></B></TD>
<TD align=right colSpan=2 height=40 vAlign=top width=553>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 width="85%">
<TBODY>
<TR>
<TD>
<DIV align=right><B><FONT size=5><SPAN class=title-1><FONT
color=#ff0000 size=2>ACCP4.0</FONT><FONT color=#333333 size=2> OLTL </FONT></SPAN></FONT></B></DIV></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD align=left class=title2 colSpan=3 height=25 vAlign=center>
<DIV align=center class=title-1>
<!-- InstanceBeginEditable name="top_Navi" -->
<table border=0 cellpadding=0 cellspacing=0 width=98%>
<tbody>
<tr>
<td height=20 width=619><div align="right"><a href="intro_smtp.htm"><img
src="Images/pre.gif" width=67 height=21 border="0"></a></div></td>
<td width=6><div align=center></div></td>
<td width=72><div align=right><a href="system_web.htm"><img
src="Images/next.gif"
width=67 height=21 border="0"></a></div></td>
</tr>
</tbody>
</table>
<!-- InstanceEndEditable --><SPAN class=title-1><FONT
size=3></FONT></SPAN></DIV></TD></TR>
<TR>
<TD align=left colSpan=3 height=100% vAlign=top><BR>
<!-- InstanceBeginEditable name="contents" -->
<table align=center border=0 cellspacing=0 cols=1 height=745 width=98%>
<tbody>
<tr>
<td height=745 valign=top><div align="center"><B><font size=3><span class=title-3-1></span></font>
</B><font size=3><span class=title-3-1><B><strong>描述发送电子邮件的过程 </strong></B></span></font></div>
<center>
<hr width="100%">
<font style="FONT-SIZE: 9pt"></font>
<div align=left>
<p align="justify" class="text">以下是将电子邮件发送给任何收件人的步骤顺序。我们假设 Martin Jones (martinjones@aptech.com) 正在给 John Smith (jsmith@yahoo.com) 发送电子邮件。</p>
<ol>
<li class="text">
<p>Martin 使用某些电子邮件客户端程序撰写邮件并将其发送至 jsmith@yahoo.com。</p>
</li>
<li class="text">
<p>SendEmail 使用端口 25 连接至其本地 SMTP 服务器, 此本地 SMTP 服务器就是 SMTP 客户端。</p>
</li>
<li class="text">
<p>然后,SMTP 客户端会检查收件人的电子邮件地址是否在其域范围内。如果在,则将电子邮件传送至本地 POP3 服务器,进而将电子邮件传送至收件人的邮箱。</p>
</li>
<li class="text">
<p>如果此处收件人的电子邮件地址 (jsmith@yahoo.com) 属于 yahoo 域, 则 SMTP 客户端将连接到相应的主机(计算机)。如果主机计算机不是电子邮件地址的目标 SMTP 服务器,则该计算机将用作 SMTP 客户端。</p>
</li>
<li class="text">
<p>如果证实主机计算机是目标 SMTP 服务器,如 Yahoo SMTP 服务器,则该计算机会将电子邮件提交给相应的 Yahoo POP3 服务器。POP3 服务器进而将电子邮件传送至 John Smith 的邮箱 (jsmith@yahoo.com)。</p>
</li>
</ol>
<p class="text">.NET Framework 提供可以使应用程序发送电子邮件的命名空间。System.Web.Mail 命名空间包含的类可用于撰写电子邮件、创建附件以及将撰写的消息作为电子邮件发送。以下是使用 .NET 类发送电子邮件的基本步骤: </p>
<ol start="1">
<li class="text">
<p class="text">使用 SmtpMail 类设置 SMTP 服务器地址 </p>
</li>
<li class="text">
<p> 使用 MailMessage 类创建消息对象 </p>
</li>
<li class="text">
<p> 设置消息对象的相应字段,如“发件人”、“收件人”和“主题”等 </p>
</li>
<li class="text">
<p> 使用 MailAttachment 类创建附件对象 </p>
</li>
<li class="text">
<p> 向该消息添加附件 </p>
</li>
<li class="text">
<p> 如果要添加更多的附件,请重复步骤 4 和 5 </p>
</li>
<li class="text">
<p> 使用 SmtpMail 类发送消息对象(包含电子邮件) </p>
</li>
</ol>
<p align="left" class="style4"> </p>
<div align=right>
<table border=0 cellpadding=0 cellspacing=0 width=520>
<tbody>
<tr>
<td height=20 width=45><a href="index.htm"><img src="Images/home.gif" width="90" height="25" border="0"></a>
<div></div></td>
<td height=20 width=400><div align=right><a href="example3.htm"></a><a href="intro_smtp.htm"><img
src="Images/pre.gif" width=67 height=21 border="0"></a></div></td>
<td width=7><div align=center></div></td>
<td width=68><div align=right><a href="system_web.htm"><img
src="Images/next.gif"
width=67 height=21 border="0"></a></div></td>
</tr>
</tbody>
</table>
</div>
</div>
<BR>
</center></td>
</tr>
</tbody>
</table>
<!-- InstanceEndEditable --></TD>
</TR>
<TR>
<TD align=left colSpan=3 height=97 vAlign=top>
<DIV align=center></DIV>
<DIV align=center></DIV>
<DIV align=center>
<OBJECT align=right classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000
codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0
height=97 width=169>
<PARAM NAME="movie" VALUE="Images/accp.swf"><PARAM NAME="quality" VALUE="high"><PARAM NAME="wmode" VALUE="transparent">
<embed
src="Images/accp.swf" width="169" height="97" align="right"
quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash"
wmode="transparent"></embed></OBJECT></DIV></TD></TR></TBODY></TABLE></DIV></BODY><!-- InstanceEnd --></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -