zoukankan      html  css  js  c++  java
  • 邮箱验证

    body>
        <form id="form1" runat="server">
        <div>
    
            发送至:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            标题:<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
            内容:<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
            <asp:Button ID="Button1" runat="server" Text="发送" />
    
        </div>
        </form>
    </body>
    前台
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Net;
    using System.Net.Mail;
    
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Button1.Click += Button1_Click;
    
        }
    
        void Button1_Click(object sender, EventArgs e)
        {
    
    
            //创建发送邮件的客户端对象
            SmtpClient sp = new SmtpClient("smtp.sina.com");//使用新浪
            //创建发送者、接收者对象
            MailAddress from = new MailAddress("lzx920627@sina.com");
            MailAddress to = new MailAddress(TextBox1.Text.Trim());
            //创建发送对象
            MailMessage mess = new MailMessage(from, to);
            //创建发送标题
            mess.Subject = TextBox2.Text;
            //创建发送内容
            mess.Body = TextBox3.Text;
            //创建验证信息
            NetworkCredential cre = new NetworkCredential("lzx920627@sina.com", "Lzx0627@!!!");
            //客户端证书设置
            sp.Credentials = cre;
            //发送
            sp.Send(mess);
        }
    }
    后台
  • 相关阅读:
    qemu-kvm虚拟化——内存
    Virtualization and Performance: Understanding VM Exits
    Linux日志文件
    Linux那些让你虎躯一震的命令
    Linux命令——watch
    Linux kernel buffer ring
    Linux命令——dmesg
    Linux命令——systemctl
    Linux命令——taskset
    /sys 和 /dev 区别
  • 原文地址:https://www.cnblogs.com/hclyz/p/6979198.html
Copyright © 2011-2022 走看看