⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sendmail.aspx

📁 实现简单邮件发送
💻 ASPX
字号:
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="SendMail.aspx.cs" Inherits="SendMail" %>
<%@ Register Src="Footer.ascx" TagName="Footer" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>发送邮件页</title>
</head>
<body style="text-align: center">
    <form id="form1" runat="server">
    <div>
    <table style="width: 755px; height: 124px; background-image: url(Image/页眉.jpg);">
    <tr>
        <td style="width: 756px; height: 118px;">
        <br /><br />
            <table style="width: 490px; height: 27px" align="right">
                <tr>
                    <td style="width: 63px">
                        <asp:HyperLink ID="HyperLink1" runat="server" Font-Size="9pt" Font-Underline="False"
                            ForeColor="Black" NavigateUrl="~/Login.aspx">重新登录</asp:HyperLink></td>
                    <td style="width: 66px">
                        <asp:HyperLink ID="HyperLink2" runat="server" Font-Size="9pt" Font-Underline="False"
                            ForeColor="Black" NavigateUrl="~/SendMail.aspx">返回首页</asp:HyperLink></td>
                    <td style="width: 51px">
                        <asp:LinkButton ID="LinkButton1" runat="server" Font-Size="9pt" Font-Underline="False"
                            ForeColor="Black" OnClick="lbtnGroupEmail_Click">邮件群发</asp:LinkButton></td>
                     <td style="width: 65px">
                         <asp:HyperLink ID="HyperLink3" runat="server" Font-Size="9pt" Font-Underline="False"
                             ForeColor="Black" NavigateUrl="~/AddFriend.aspx">添加好友</asp:HyperLink></td>
                     <td style="width: 64px">
                         <asp:HyperLink ID="HyperLink4" runat="server" Font-Size="9pt" Font-Underline="False"
                             ForeColor="Black" NavigateUrl="~/FriendInfo.aspx">查看好友</asp:HyperLink></td>
                     <td style="width: 74px">
                         <asp:HyperLink ID="HyperLink5" runat="server" Font-Size="9pt" Font-Underline="False"
                             ForeColor="Black" NavigateUrl="~/EmailInfo.aspx">查看邮件信息</asp:HyperLink></td>
                     <td>
                         <asp:HyperLink ID="HyperLink6" runat="server" Font-Size="9pt" Font-Underline="False"
                             ForeColor="Black" NavigateUrl="~/EEmailInfo.aspx">查看紧急邮件</asp:HyperLink></td>
                </tr>
            </table>
        </td>
    </tr>
</table>
        <table style="width: 755px; height: 494px; background-image: url(Image/内容.jpg);" align="center" cellpadding="0" cellspacing="0">
        <tr>
                <td style="width: 162px; text-align: center; background-color: transparent;">
                    <asp:Label ID="labReceiver" runat="server" Text="收件人:" Font-Size="9pt"></asp:Label></td>
                <td style="width: 579px;text-align: left;">
                <asp:TextBox ID="txtReceiver" runat="server" Width="560px" Font-Size="9pt"></asp:TextBox><asp:Label ID="labSelReceiver" runat="server" Font-Size="9pt" Text="请选择好友信箱:" BackColor="White" Height="20px" Width="96px"></asp:Label><asp:DropDownList ID="ddlReceiver" runat="server" Width="468px" Font-Size="9pt" EnableTheming="True" AutoPostBack="True" OnSelectedIndexChanged="ddlReceiver_SelectedIndexChanged">
                    </asp:DropDownList>
                    <asp:TextBox ID="txtGroupEmail" runat="server" Width="560px" Font-Size="9pt" Visible="False"></asp:TextBox>
                    <asp:Label ID="labSelGroup" runat="server" Font-Size="9pt" Text="请选择群发用户:" Visible="False" BackColor="White" Height="20px" Width="96px"></asp:Label><asp:DropDownList ID="ddlGroupEmail" runat="server" Width="470px" Font-Size="9pt" Visible="False" OnSelectedIndexChanged="ddlGroupEmail_SelectedIndexChanged" AutoPostBack="True">
                    </asp:DropDownList>
                    </td>
            </tr>
        <tr>
                <td style="width: 162px; text-align: center; background-color: transparent; height: 23px;">
                    <asp:Label ID="labSender" runat="server" Text="发件人:" Font-Size="9pt"></asp:Label></td>
                <td style="width: 579px; text-align: left; height: 23px;">
                    <asp:TextBox ID="txtSender" runat="server" Width="560px" Font-Size="9pt"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="width: 162px; text-align: center; background-color: transparent; height: 25px;">
                    <asp:Label ID="Label5" runat="server" Text="发件人名字:" Font-Size="9pt"></asp:Label></td>
                <td style="width: 579px; text-align: left; height: 25px;">
                    <asp:TextBox ID="txtSUser" runat="server" Width="560px" Font-Size="9pt"></asp:TextBox></td>
            </tr>
             <tr>
                <td style="width: 162px; text-align: center; background-color: transparent; height: 23px;">
                    <asp:Label ID="Label1" runat="server" Text="发送邮件服务器:" Font-Size="9pt"></asp:Label></td>
                <td style="width: 579px; text-align: left; height: 23px;">
                    <asp:TextBox ID="txtEServer" runat="server" Width="560px" Font-Size="9pt"></asp:TextBox></td>
            </tr>
             <tr>
                <td style="width: 162px; text-align: center; background-color: transparent;">
                    <asp:Label ID="Label2" runat="server" Text="发送邮件用户:" Font-Size="9pt"></asp:Label></td>
                <td style="width: 579px; text-align: left;">
                    <asp:TextBox ID="txtEUser" runat="server" Width="560px" Font-Size="9pt"></asp:TextBox></td>
            </tr>
             <tr>
                <td style="width: 162px; text-align: center; background-color: transparent;">
                    <asp:Label ID="Label3" runat="server" Text="发送邮件用户密码:" Font-Size="9pt"></asp:Label></td>
                <td style="width: 579px; text-align: left;">
                    <asp:TextBox ID="txtEPwd" runat="server" Width="560px" Font-Size="9pt" TextMode="Password"></asp:TextBox></td>
            </tr>
             <tr>
                <td style="width: 162px; text-align: center; background-color: transparent;">
                    <asp:Label ID="Label4" runat="server" Text="发送邮件服务器端口:" Font-Size="9pt"></asp:Label></td>
                <td style="width: 579px; text-align: left;">
                    <asp:TextBox ID="txtEPort" runat="server" Width="560px" Font-Size="9pt"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="width: 162px; text-align: center; background-color: transparent; height: 25px;">
                    <asp:Label ID="labSubject" runat="server" Text="主题:" Font-Size="9pt"></asp:Label></td>
                <td style="width: 579px; text-align: left; height: 25px;">
                    <asp:TextBox ID="txtSubject" runat="server" Width="560px" Font-Size="9pt"></asp:TextBox>
                    </td>
            </tr>
            <tr>
                <td style="width: 162px; text-align: center; background-color: transparent;">
                    <asp:Label ID="labContent" runat="server" Text="内容:" Font-Size="9pt"></asp:Label></td>
                <td style="width: 579px; text-align: left;">
                    <asp:TextBox ID="txtContent" runat="server" Height="160px" TextMode="MultiLine" Width="560px" Font-Size="9pt"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="width: 162px; text-align: center; background-color: transparent; height: 23px;">
                    <asp:Label ID="labAccessories" runat="server" Text="附件:" Font-Size="9pt"></asp:Label></td>
                <td style="width: 579px; text-align: left; height: 23px;">
                <input id="upFile" type="file" runat="server" style="width: 522px" Font-Size="9pt" />
                    <asp:Button ID="btnTake" runat="server" Text="上传" OnClick="btnTake_Click" Width="40px" Font-Size="9pt" /></td>
            </tr>
            <tr>
                <td style="width: 162px; text-align: center; background-color: transparent; height: 14px;">
                    <asp:Label ID="labTakeAcc" runat="server" Text="已上传附件:" Font-Size="9pt"></asp:Label></td>
                <td style="width: 579px; text-align: left; height: 14px;">
                    <asp:DropDownList ID="ddlAccessories" runat="server" Width="523px" Font-Size="9pt">
                    </asp:DropDownList>
                    <asp:Button ID="btnDelete" runat="server" Text="删除" OnClick="btnDelete_Click" Enabled="False" Width="40px" Font-Size="9pt" /></td>
            </tr>
             <tr>
             <td style="width: 162px; text-align: center; height: 38px;"></td>
                <td style="width: 579px; text-align: center; height: 38px; vertical-align: top;">
                    <asp:CheckBox ID="cbErgency" runat="server" Font-Size="9pt" Text="是否紧急" />&nbsp;&nbsp;
                    &nbsp; &nbsp;&nbsp;
                    <asp:Button ID="btnSend" runat="server" OnClick="btnSend_Click" Text="发送" Width="77px" Font-Size="9pt" /></td>
            </tr>
        </table>
        <uc1:Footer ID="Footer1" runat="server" />
    </form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -