问题描述
在我的C#应用程序中,我想将电子邮件发送给嵌入HTML表的客户.如何做到这一点.谁能帮我解决这个问题.这是我需要的模型:
尊敬的客户,
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
/>/>
XXXXXXXXXX XXXXXXXXXX
xxxxx xxxxxx
xxxxx xxxxxx
xxxxx xxxxxxx
xxxxxx xxxxxxxxx
谢谢
xxxxxx
在Advance中致谢
Hi,
In my C# application I want to send the email to customers with embeded HTML Table. How to do this one. Can any one help me to solve this problem. Here is the model I need:
Dear Customer,
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
XXXXXXXXXXXXXXXXXXXX
xxxxx xxxxxx
xxxxx xxxxxx
xxxxx xxxxxxx
xxxxxx xxxxxxxxx
Thanks
xxxxxx
Thanks in Advance
推荐答案
string body = "You have received a status update from " + Session["name"].ToString() + ", Department : " + Session["deptt"].ToString() + " ,with reference to Assignment ID: " + lblassno.Text + " /Task ID: " + taskid + ". Kindly login TMS on Intranet Portal to view the details.";
body += "<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><span style="mso-bidi-font-style:normal;font-style: italic;font-size: small;">This is a System generated message,";
body += "kindly do not reply to this.<o:p xmlns:o="#unknown"></o:p></span>";
并发送邮件
and send mail
MailMessage m = new MailMessage("senderid", To);
m.Subject = Subject;
m.Body = Body;
m.IsBodyHtml = true;
m.From = new MailAddress(From);
m.To.Add(new MailAddress(To));
SmtpClient smtp = new SmtpClient();
smtp.Host = "mail.google.com";
NetworkCredential authinfo = new NetworkCredential("[email protected]", "pass123");
smtp.UseDefaultCredentials = false;
smtp.Credentials = authinfo;
smtp.Send(m);
这篇关于如何使用带有嵌入式HTML TABLE的C#发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!