System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("发件邮箱@gmail.com","收件邮箱@163.com", "测试标题", "测试内容");
System.Net.Mail.SmtpClient smtpClient = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587);
smtpClient.Credentials = new System.Net.NetworkCredential("发件邮箱@gmail.com", "登录密码");
smtpClient.EnableSsl = true;
smtpClient.Send(message);//同步方法
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage("发件邮箱@sohu.com","收件邮箱@163.com","测试标题","测试内容");
System.Net.Mail.SmtpClient smtpClient = new System.Net.Mail.SmtpClient("smtp.sohu.com");
smtpClient.Credentials = new System.Net.NetworkCredential("发件邮箱@sohu.com", "登录密码");
smtpClient.Send(message);//同步方法