郵件發(fā)送測(cè)試頁(yè)面--前臺(tái)頁(yè)面
發(fā)布時(shí)間:2008-07-08 閱讀數(shù): 次 來源:網(wǎng)樂原科技
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="Test.SendMailSample" %>
<HTML>
<HEAD>
<title>郵件發(fā)送例子</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">TD {
FONT-SIZE: 9pt; FONT-FAMILY: "宋體"
}
.TextBox {
BORDER-RIGHT: #000000 thin dashed; BORDER-TOP: #000000 thin dashed; BORDER-LEFT: #000000 thin dashed; BORDER-BOTTOM: #000000 thin dashed
}
</style>
</HEAD>
<body text="#000000" bgColor="#ffffff">
<form runat="server">
<table style="BORDER-COLLAPSE: collapse" borderColor="#111111" cellSpacing="0" cellPadding="3" width="500" align="center" border="1">
<tr>
<td align="middle" colSpan="2">郵件發(fā)送例子(SOCKET類)</td>
</tr>
<asp:panel id="pelMessage" Visible="False" Runat="server">
<TR>
<TD align="middle" colSpan="2">
<asp:Label id="lblMessage" runat="server"></asp:Label></TD>
</TR>
</asp:panel>
<tr>
<td align="right" width="150">SMTP服務(wù)器:</td>
<td width="350"><asp:textbox id="txtSmtpHost" runat="server" CssClass="TextBox" MaxLength="50"></asp:textbox><asp:requiredfieldvalidator id="rfvSmtpHost" runat="server" ErrorMessage="*" ControlToValidate="txtSmtpHost" Display="Dynamic"></asp:requiredfieldvalidator></td>
</tr>
<tr>
<td align="right" width="150">SMTP服務(wù)器端口:</td>
<td width="350"><asp:textbox id="txtPort" runat="server" CssClass="TextBox" MaxLength="6"></asp:textbox><asp:requiredfieldvalidator id="rfvPort" runat="server" ErrorMessage="*" ControlToValidate="txtPort" Display="Dynamic"></asp:requiredfieldvalidator><asp:regularexpressionvalidator id="revPort" runat="server" ErrorMessage="只能輸入數(shù)字" ValidationExpression="\d{1,}" ControlToValidate="txtPort" Display="Dynamic"></asp:regularexpressionvalidator></td>
</tr>
<tr>
<td align="right" width="150">郵件發(fā)送者:</td>
<td width="350"><asp:textbox id="txtFrom" runat="server" CssClass="TextBox" MaxLength="50"></asp:textbox><asp:requiredfieldvalidator id="rfvFrom" runat="server" ErrorMessage="*" ControlToValidate="txtFrom" Display="Dynamic"></asp:requiredfieldvalidator>
<asp:regularexpressionvalidator id="revFrom" runat="server" ErrorMessage="郵件格式錯(cuò)誤" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="txtFrom" Display="Dynamic"></asp:regularexpressionvalidator></td>
</tr>
<tr>
<td align="right" width="150">發(fā)送者顯示名稱:</td>
<td width="350"><asp:textbox id="txtFromName" runat="server" CssClass="TextBox" MaxLength="20"></asp:textbox></td>
</tr>
<tr>
<td align="right" width="150">郵件接收者:</td>
<td width="350"><asp:textbox id="txtTo" runat="server" CssClass="TextBox" MaxLength="50"></asp:textbox><asp:requiredfieldvalidator id="rfvTo" runat="server" ErrorMessage="*" ControlToValidate="txtTo" Display="Dynamic"></asp:requiredfieldvalidator>
<asp:regularexpressionvalidator id="revTo" runat="server" ErrorMessage="郵件格式錯(cuò)誤" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="txtTo" Display="Dynamic"></asp:regularexpressionvalidator></td>
</tr>
<tr>
<td align="right" width="150">接收者顯示名稱:</td>
<td width="350"><asp:textbox id="txtToName" runat="server" CssClass="TextBox" MaxLength="20"></asp:textbox></td>
</tr>
<tr>
<td align="right" width="150">郵件發(fā)送優(yōu)先級(jí):</td>
<td width="350"><asp:dropdownlist id="ddlPriority" runat="server">
<asp:ListItem Value="高">高</asp:ListItem>
<asp:ListItem Value="默認(rèn)" Selected="True">默認(rèn)</asp:ListItem>
<asp:ListItem Value="低">低</asp:ListItem>
</asp:dropdownlist></td>
</tr>
<tr>
<td align="right" width="150">發(fā)送HTML格式的郵件:</td>
<td width="350"><asp:dropdownlist id="ddlHtml" runat="server">
<asp:ListItem Value="是" Selected="True">是</asp:ListItem>
<asp:ListItem Value="否">否</asp:ListItem>
</asp:dropdownlist></td>
</tr>
<tr>
<td align="right" width="150">郵件主題:</td>
<td width="350"><asp:textbox id="txtSubject" runat="server" CssClass="TextBox" MaxLength="50"></asp:textbox>
<asp:RequiredFieldValidator id="rfvSubject" runat="server" ErrorMessage="*" ControlToValidate="txtSubject" Display="Dynamic"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td align="right" width="150">郵件內(nèi)容:</td>
<td width="350">
<asp:textbox id="txtMessage" runat="server" Rows="15" TextMode="MultiLine" CssClass="TextBox" Columns="40"></asp:textbox>
<asp:RequiredFieldValidator id="rfvMessage" runat="server" ErrorMessage="*" ControlToValidate="txtMessage" Display="Dynamic"></asp:RequiredFieldValidator>
</td>
</tr>
<tr align="middle">
<td colSpan="2">
<asp:Button id="btnSendMail" runat="server" Text="發(fā)送郵件" CssClass="TextBox" BackColor="Silver" ForeColor="Blue"></asp:Button>
</td>
</tr>
</table>
</form>
</body>
</HTML>