Email

 string password="ff";
            MailMessage messge = new MailMessage();
            messge.From = new MailAddress(messge.From.Address);
            messge.To.Add(new MailAddress("[email protected]"));
            messge.Subject = "password";
            messge.IsBodyHtml = false;

            messge.Body = "您的密码是:   " + password + "       " + DateTime.Now.ToString();
            SmtpClient sc = new SmtpClient();
            sc.Send(messge);




2.system.net>
    <mailSettings>
      <smtp deliveryMethod="Network" from="[email protected]">
        <network host="smtp.126.com" port="25" password="lf87" userName="[email protected]"/>
      </smtp>
    </mailSettings>
  </system.net>
</configuration>

你可能感兴趣的:(email)