Front page mail Send test

Source: Internet
Author: User
Tags mail server port
Pages <%@ page language= "C #" codebehind= "WebForm1.aspx.cs" autoeventwireup= "false" inherits= "test.sendmailsample"% >
<HTML>
<HEAD>
<title> e-Mail Send example </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<style type= "Text/css" &GT;TD {
font-size:9pt; font-family: "Song Body"
}
. 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= "align=" Center "border=" 1 ">
<tr>
&LT;TD align= "Middle" colspan= "2" > Mail sending example (socket Class) </td>
</tr>
<asp:panel id= "Pelmessage" visible= "False" runat= "Server" >
<TR>
&LT;TD align= "Middle" colspan= "2" >
<asp:label id= "lblmessage" runat= "Server" ></asp:Label></TD>
</TR>
</asp:panel>
<tr>
&LT;TD align= "Right" width= ":</td>" &GT;SMTP server
&LT;TD width= "><asp:textbox" id= "Txtsmtphost" runat= "Server" cssclass= "textbox" Maxlength= "></asp" : Textbox><asp:requiredfieldvalidator id= "Rfvsmtphost" runat= "Server" errormessage= "*" controltovalidate= " Txtsmtphost "display=" Dynamic "></asp:requiredfieldvalidator></td>
</tr>
<tr>
&LT;TD align= "right" width= "" ">smtp Server port:</td>
&LT;TD width= "><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= " The server "errormessage=" can only enter the number "validationexpression=" \d{1,} "controltovalidate= Txtport" display= "Dynamic" ></ Asp:regularexpressionvalidator></td>
</tr>
<tr>
&LT;TD align= "right" width= ">" Mail Sender:</td>
&LT;TD width= "><asp:textbox" id= "Txtfrom" runat= "Server" cssclass= "textbox" Maxlength= "></asp": Textbox><asp:requiredfieldvalidator id= "Rfvfrom" runat= "Server" errormessage= "*" controltovalidate= "TxtFrom" Display= "Dynamic" ></asp:requiredfieldvalidator>
<asp:regularexpressionvalidator id= "Revfrom" runat= "Server" errormessage= "message Format error" validationexpression= "\w+ ([-+ .] \w+) *@\w+ ([-.] \w+) *\.\w+ ([-.] \w+) * "controltovalidate=" Txtfrom "display=" Dynamic "></asp:regularexpressionvalidator></td>
</tr>
<tr>
&LT;TD align= "Right" width= "I" > Sender display Name:</td>
&LT;TD width= "><asp:textbox" id= "Txtfromname" runat= "Server" cssclass= "textbox" Maxlength= "></asp" :textbox></td>
</tr>
<tr>
&LT;TD align= "right" width= "> Mail Receiver":</td>
&LT;TD width= "><asp:textbox" id= "Txtto" runat= "Server" cssclass= "textbox" Maxlength= "></asp": Textbox><asp:requiredfieldvalidator id= "rfvto" runat= "Server" errormessage= "*" controltovalidate= "TxtTo" Display= "Dynamic" ></asp:requiredfieldvalidator>
<asp:regularexpressionvalidator id= "revto" runat= "Server" errormessage= "message Format error" validationexpression= "\w+ ([-+.] \w+) *@\w+ ([-.] \w+) *\.\w+ ([-.] \w+) * "controltovalidate=" Txtto "display=" Dynamic "></asp:regularexpressionvalidator></td>
</tr>
<tr>
&LT;TD align= "right" width= "> receiver" display name:</td>
&LT;TD width= "><asp:textbox" id= "Txttoname" runat= "Server" cssclass= "textbox" Maxlength= "></asp": Textbox></td>
</tr>
<tr>
&LT;TD align= "right" width= ">" Message priority:</td>
&LT;TD width= "><asp:dropdownlist" id= "ddlpriority" runat= "Server" >
<asp:listitem value= "High" > High </asp:ListItem>
<asp:listitem value= "Default" selected= "True" > Default </asp:ListItem>
<asp:listitem value= "Low" > Low </asp:ListItem>
</asp:dropdownlist></td>
</tr>
<tr>
&LT;TD align= "Right" width= "I" > Send HTML mail:</td>
&LT;TD width= "><asp:dropdownlist" id= "ddlhtml" runat= "Server" >
<asp:listitem value= "yes" selected= "True" > is </asp:ListItem>
<asp:listitem value= "No" > No </asp:ListItem>
</asp:dropdownlist></td>
</tr>
<tr>
&LT;TD align= "Right" width= "I" > Mail theme:</td>
&LT;TD width= "><asp:textbox" id= "Txtsubject" runat= "Server" cssclass= "textbox" Maxlength= "></asp": Textbox>
<asp:requiredfieldvalidator id= "Rfvsubject" runat= "Server" errormessage= "*" controltovalidate= "TxtSubject" Display= "Dynamic" ></asp:RequiredFieldValidator></td>
</tr>
<tr>
&LT;TD align= "right" width= ">" Message content:</td>
&LT;TD width= ">"
<asp:textbox id= "Txtmessage" runat= "rows=" textmode= "MultiLine" cssclass= "textbox" columns= ">" </asp:textbox>
<asp:requiredfieldvalidator id= "Rfvmessage" runat= "Server" errormessage= "*" controltovalidate= "TxtMessage" Display= "Dynamic" ></asp:RequiredFieldValidator>
</td>
</tr>
<tr align= "Middle" >
&LT;TD colspan= "2" >
<asp:button id= "Btnsendmail" runat= "Server" text= "Send Mail" cssclass= "TextBox" backcolor= "Silver" forecolor= "Blue" ></asp:Button>
</td>
</tr>
</table>
</form>
</body>
</HTML>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.