错误提示:与服务器的传输连接失败。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Runtime.InteropServices.COMException: 与服务器的传输连接失败。 源错误: 
行 62:  Message.BodyFormat = MailFormat.Html;
行 63:  SmtpMail.SmtpServer = "stmp.163.com";
行 64:  SmtpMail.Send(Message);
行 65:  }
行 66:  }
 源文件: d:\inetpub\wwwroot\test\sendmail.aspx.cs    行: 64 
----------------------------------------------------------------
.aspx代码:<%@ Page language="c#" Codebehind="SendMail.aspx.cs" AutoEventWireup="false" Inherits="Test.SendMail" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:TextBox id="sendtext" style="Z-INDEX: 101; LEFT: 192px; POSITION: absolute; TOP: 120px"
runat="server"></asp:TextBox>
<asp:Label id="Label1" style="Z-INDEX: 102; LEFT: 96px; POSITION: absolute; TOP: 120px" runat="server">发送者Email</asp:Label>
<asp:Label id="Label2" style="Z-INDEX: 103; LEFT: 96px; POSITION: absolute; TOP: 152px" runat="server">接受者Email</asp:Label>
<asp:TextBox id="recevietext" style="Z-INDEX: 104; LEFT: 192px; POSITION: absolute; TOP: 152px"
runat="server"></asp:TextBox>
<asp:Label id="Label3" style="Z-INDEX: 105; LEFT: 112px; POSITION: absolute; TOP: 184px" runat="server">发送内容</asp:Label>
<asp:TextBox id="contact" style="Z-INDEX: 106; LEFT: 192px; POSITION: absolute; TOP: 184px" runat="server"
TextMode="MultiLine" Width="160px" Height="96px"></asp:TextBox>
<asp:Button id="sendbutton" style="Z-INDEX: 107; LEFT: 136px; POSITION: absolute; TOP: 216px"
runat="server" Text="发送"></asp:Button>
</form>
</body>
</HTML>
-------------------------------------------------------
.cs代码:using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Mail;
using System.Web.Util;
namespace Test
{
/// <summary>
/// WebForm1 的摘要说明。
/// </summary>
public class SendMail : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox sendtext;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.TextBox recevietext;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.Button sendbutton;
protected System.Web.UI.WebControls.TextBox contact;
private MailMessage Message;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
Message = new MailMessage();
} #region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{    
this.sendbutton.Click += new System.EventHandler(this.sendbutton_Click);
this.Load += new System.EventHandler(this.Page_Load); }
#endregion private void sendbutton_Click(object sender, System.EventArgs e)
{
Message.From = this.sendtext.Text.Trim();
Message.To = this.recevietext.Text.Trim();
Message.Subject = "邮件测试";
Message.Body = this.contact.Text.Trim();
Message.BodyFormat = MailFormat.Html;
SmtpMail.SmtpServer = "stmp.163.com";
SmtpMail.Send(Message);
}
}
}