zoukankan      html  css  js  c++  java
  • C#.NET实现邮件的发送

     public bool ReceiveEmail()
        {
            try
            {
                #region 邮件内容设置
                    //MailAddress MFrom = new MailAddress("aa@sohu.com");
                    //MailAddress MTo = new MailAddress("bb@sohu.com");
                    System.Net.Mail.MailMessage MailM = new System.Net.Mail.MailMessage("aa@sohu.com", "bb@sohu.com");
                    MailM.Subject = "zhuti";
                    MailM.Body = "neirong"
                    MailM.IsBodyHtml = true;
                    MailM.BodyEncoding = System.Text.Encoding.GetEncoding("GB2312");
                    #endregion

                    #region Smtp设置
                    SmtpClient SmtpC = new SmtpClient("smtp.sohu.com", 25);
                    SmtpC.UseDefaultCredentials = false;
                    SmtpC.Credentials = new System.Net.NetworkCredential("aa@sohu.com", "iloveyou");
                    SmtpC.DeliveryMethod = SmtpDeliveryMethod.Network;
                    SmtpC.Send(MailM);
                    #endregion
                }
              catch (Exception err)
              {
                  return false;
              }
        }

  • 相关阅读:
    stl_hash_set.h
    stl_hash_map.h
    stl_algobase.h
    stl_relops.h
    stl_algo.h
    VC6常用插件
    visual assist(VA)设置快捷键(其它安装的插件设置快捷键也在这里)
    SVN常用命令说明
    Android 调用相册 拍照 实现系统控件缩放 切割图片
    Android 一个3D相册源码
  • 原文地址:https://www.cnblogs.com/huangwen/p/1123482.html
Copyright © 2011-2022 走看看