using System.Net;
using System.Net.Mail;
MailAddress ma = new MailAddress("1234@qo.com", "我的昵称");
MailMessage mm = new MailMessage();
mm.Subject = "这是测试邮件";
mm.Body = "<b style=\"color:red;\">红色字体</b>";
mm.IsBodyHtml = true; // 是否是HTML格式的内容
mm.From = ma;
mm.To.Add("1234@qo.com");
SmtpClient sc = new SmtpClient();
sc.Host = "smtp.q0.com"; //SMTP服务器地址
sc.Port = 25; // SMTP服务器端口
sc.Credentials = new NetworkCredential("1234@qo.com", "123456"); // 建立SMTP账号和密码信息
sc.Send(mm); // 发送邮件
结果如下图