日期:2014-05-17 浏览次数:20475 次
objMailMessage.From = new MailAddress("Tacc123@163.com","Tacc123");
objMailMessage.To.Add(_emailaddr);
objMailMessage.Subject = "俱乐部:会员激活";//发送邮件的标题
objMailMessage.Body = strbody;//发送邮件的内容
objMailMessage.BodyEncoding = System.Text.Encoding.UTF8;//邮件内容编码
objMailMessage.IsBodyHtml = true;//是否是HTML邮件
SmtpClient client = new SmtpClient();
client.Host = "smtp.163.com";
//设置用于 SMTP 事务的端口,默认的是 25
//client.Port = 25;
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("Tacc123", "password");
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Send(objMailMessage);
objMailMessage.From = new MailAddress("info@zhvipclub.com", "vipclub");
objMailMessage.To.Add(_emailaddr);
objMailMessage.Subject = "俱乐部:会员激活";//发送邮件的标题
objMailMessage.Body = strbody;//发送邮件的内容
objMailMessage.BodyEncoding = System.Text.Encoding.UTF8;//邮件内容编码
objMailMessage.IsBodyHtml = true;//是否是HTML邮件
SmtpClient client = new SmtpClient();
client.Host = "smtp.zhvipclub.com";
//client.Port = 25;
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("info", "password");
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Send(objMailMessage);