static void Main(string[] args)
        {
            string mailAddress_from="yftan@chinchool.net";

            System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("smtp.chinool.net", 25); 
            client.Credentials = new System.Net.NetworkCredential(mailAddress_from, "");
            try
            {
                client.Send(mailAddress_from, "14816898@qq.com", "test2", "hello world");
                Console.WriteLine("邮件发送完毕");
            }
            catch (Exception e)
            {

                Console.WriteLine(e.Message);
                Console.WriteLine("失败!");
            }

          
            Console.Read();
        }

 

相关文章:

  • 2021-09-07
  • 2022-12-23
  • 2022-02-01
  • 2022-12-23
  • 2021-11-12
  • 2021-07-24
猜你喜欢
  • 2022-12-23
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
  • 2021-11-30
相关资源
相似解决方案