我最近一直在写一堆电子邮件代码,但我发现,如果有一个库可以让您用C#流畅地创建电子邮件,那将非常酷。
我快速浏览了一下,但找不到任何东西,所以想知道是否有人知道C#是否已经存在一个流畅的电子邮件库?
最佳答案
我最终在GitHub上找到了这个,它做得很好
https://github.com/dkarzon/FluentEmail
还具有允许模板使用的额外好处,该模板可以这样使用:
var email = Email
.From("john@email.com")
.To("bob@email.com", "bob")
.Subject("hows it going bob")
.UsingTemplate(@"C:\Emailer\TransactionTemplate.htm")
.Replace("<%CurrentDate%>", DateTime.Now.ToShortDateString())
.Replace("<%FullName%>", fullName)
.Replace("<%SaleDate%>", saleDate)