发送Email 为什么MailMessage不能以无参数重载?
MailMessage msg = new MailMessage(tbFromEmail.Text,tbToEmail.Text);msg.Subject = "多有件地址";
msg.Body = "Mail body content";
msg.IsBodyHtml = true;
msg.Priority = MailPriority.High;
SmtpClient c = new SmtpClient();
c.Send(msg);
Response.Write("ok");
上面这样发信是成功的,但是下面的格式就不行了。各位遇到这样的情况和有什么办法可以解决?
MailMessage msg = new MailMessage();
msg.From = new MailAddress(tbFromEmail.Text);
msg.To.Add(new MailAddress(tbToEmail.Text));
msg.Subject = "多有件地址";
msg.Body = "Mail body content";
msg.IsBodyHtml = true;
msg.Priority = MailPriority.High;
SmtpClient c = new SmtpClient();
c.Send(msg);
Response.Write("ok"); --------------------编程问答-------------------- 顶一下,就没有人回答了吗? --------------------编程问答-------------------- 应该是可以的
补充:.NET技术 , ASP.NET