C#生成eml文件

 

使用LumiSoft.Net,下载地址见http://www.lumisoft.ee/lswww/download/downloads/Net/

// Creating a new simple message
Mime m = new Mime();
MimeEntity mainEntity = m.MainEntity;
// Force to create From: header field
mainEntity.From = new AddressList();
mainEntity.From.Add(new MailboxAddress("dispaly name", "user@domain.com"));
// Force to create To: header field
mainEntity.To = new AddressList();
mainEntity.To.Add(new MailboxAddress("dispaly name", "user@domain.com"));
mainEntity.Subject = "subject";
mainEntity.ContentType = MediaType_enum.Text_plain;
mainEntity.ContentTransferEncoding = ContentTransferEncoding_enum.QuotedPrintable;
mainEntity.DataText = "Message body text.";

m.ToFile("e://message.eml");

 

大家有没有更好的生成eml的方法?请留言

posted @ 2012-06-19 15:04  代码示例  阅读(2704)  评论(4编辑  收藏  举报