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

📄 sendemail.aspx

📁 几个不错的ASP.NTE例子
💻 ASPX
字号:
<%@ Page Language="vb" %>
<%@ Import Namespace="System.Web.Mail" %>
<html>
<head>
<script runat="server">
   Sub Send_Click(Sender As Object, e As EventArgs)
      'Create MailMessage instance, set properties and send
      Dim Mail As New MailMessage
      Mail.To = ToText.Text
      Mail.CC = CCText.Text
      Mail.BCC = BCCText.Text
      Mail.Subject = SubjectText.Text
      Mail.Body = BodyText.Text
      Mail.From = "" 'email_address here
      SmtpMail.SmtpServer = "" 'server_name here
      SmtpMail.Send(Mail)
      'Use the first label to display status
      ToLabel.Text = "Mail Sent"
      'Hide the rest of the controls
      ToText.Visible = False
      CCLabel.Visible = False
      CCText.Visible = False
      BCCLabel.Visible = False
      BCCText.Visible = False
      SubjectLabel.Visible = False
      SubjectText.Visible = False
      BodyLabel.Visible = False
      BodyText.Visible = False
      Send.Visible = False
      Reset.Visible = False
      'Add a Hyperlink control to allow sending another email
      Dim Link As New HyperLink
      Link.Text = "Click here to send another email."
      Link.NavigateUrl = "SmtpEmail.aspx"
      Page.Controls.Add(Link)
   End Sub
</script>
</head>
<body>
<form runat="server">
<table>
   <tr>
      <td>
         <asp:label id="ToLabel" text="收件人:" runat="server"/>
      </td>
      <td>
         <asp:textbox id="ToText" runat="server"/>
      </td>
   </tr>
   <tr>
      <td>
         <asp:label id="CCLabel" text="抄送:" runat="server"/>
      </td>
      <td>
         <asp:textbox id="CCText" runat="server"/>
      </td>
   </tr>
   <tr>
      <td>
         <asp:label id="BCCLabel" text="暗送:" runat="server"/>
      </td>
      <td>
         <asp:textbox id="BCCText" runat="server"/>
      </td>
   </tr>
   <tr>
      <td>
         <asp:label id="SubjectLabel" text="主题:" runat="server"/>
      </td>
      <td>
         <asp:textbox id="SubjectText" runat="server"/>
      </td>
   </tr>
   <tr>
      <td>
         <asp:label id="BodyLabel" text="内容:" runat="server"/>
      </td>
      <td>
         <asp:textbox id="BodyText" textmode="multiline" rows="10" columns="60" runat="server"/>
      </td>
   </tr>
   <tr>
      <td>
         <asp:button id="Send" text="发送" onclick="Send_Click" runat="server"/>
      </td>
      <td>
         <input id="Reset" type="reset" value="重写"
            runat="server"/>
      </td>
   </tr>
</table>
</form>
</body>
</html>

⌨️ 快捷键说明

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