gpt4 book ai didi

.net - 数字签名电子邮件

转载 作者:行者123 更新时间:2023-12-02 05:19:32 24 4
gpt4 key购买 nike

我有一个发送客户报表的应用程序。我有一些客户要求对电子邮件(带有 pdf 附件)进行数字签名。我目前正在使用 System.Net.Mail 发送电子邮件。我似乎找不到明确的答案,这可以在 .NET 中完成还是我应该研究第 3 方组件?

最佳答案

查看 Mail.dll email component :

IMail email = Mail.Text("This is message body")
.Subject("Test")
.From(new MailBox("mail@in_the_certificate.com", "Alice"))
.To(new MailBox("bob@mail.com", "Bob"))
.AddAttachment(@"c:\invoice.pdf")
.SignWith(new X509Certificate2("TestCertificate.pfx", ""))
.Create();

using (Smtp smtp = new Smtp())
{
smtp.Connect("smtp.server.com");
smtp.Ehlo();
smtp.Login("user", "password");
smtp.SendMessage(email);
smtp.Close();
}

您还可以使用 Mail.dll 的模板引擎来创建邮件正文。

免责声明:请注意,这是我帮助创建的商业产品(尽管价格合理)。

关于.net - 数字签名电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4609579/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com