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的方法?请留言


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM