顯示具有 加簽寄信 標籤的文章。 顯示所有文章
顯示具有 加簽寄信 標籤的文章。 顯示所有文章

2022年6月10日 星期五

[研究][ASP.NET]加簽寄信-值不能為 null。參數名稱: findValue

[研究][ASP.NET]加簽寄信-值不能為 null。參數名稱: findValue

2022-06-07 

環境:Visual Studio 2022 + ASP.NET + WebForm + Web Application + C#

********************************************************************************

把

//從Web.Config中抓Email憑證序號值
string emailCertificateSN = ConfigurationManager.AppSettings["EmailCertificateSN"];
//用 Email憑證序號抓比較不會抓錯
X509Certificate2 signCert = store.Certificates.Find(X509FindType.FindBySerialNumber, emailCertificateSN, false)[0];

改成下面,失敗直接

//從Web.Config中抓Email憑證序號值
string emailCertificateSN = ConfigurationManager.AppSettings["EmailCertificateSN"];
if (emailCertificateSN == null || emailCertificateSN == "")
{
    return "讀取不到Email憑證序號。";
}
//用 Email憑證序號抓比較不會抓錯
X509Certificate2 signCert = store.Certificates.Find(X509FindType.FindBySerialNumber, emailCertificateSN, false)[0];

(完)

2021年12月16日 星期四

[研究]Outlook 2019 設定加簽寄信 (數位簽章、憑證、數位識別碼、簽章憑證、Digital signing)

[研究]Outlook 2019 設定加簽寄信 (數位簽章、憑證、數位識別碼、簽章憑證、Digital signing)

2021-12-26










(完)

相關

以數位簽章保護郵件的安全

https://support.microsoft.com/zh-tw/office/%E4%BB%A5%E6%95%B8%E4%BD%8D%E7%B0%BD%E7%AB%A0%E4%BF%9D%E8%AD%B7%E9%83%B5%E4%BB%B6%E7%9A%84%E5%AE%89%E5%85%A8-549ca2f1-a68f-4366-85fa-b3f4b5856fc6

查看憑證

https://support.microsoft.com/zh-tw/office/%E6%9F%A5%E7%9C%8B%E6%86%91%E8%AD%89-b73abe88-9f85-48a1-b00f-7ade1c0ec49f

2019年10月13日 星期日

[研究][C#][ASP.NET] 加簽寄信 (使用 MailKit 和 MimeKit)

[研究][C#][ASP.NET] 加簽寄信4 (使用 MailKit 和 MimeKit)

2019-10-13, 2020-01-21, 2021-11-29 更新
2022-06-06 Email憑證建議改用憑證序號抓

********************************************************************************
相關3篇

[研究][C#][ASP.NET] 加簽寄信 (使用 MailKit 和 MimeKit)
https://shaurong.blogspot.com/2019/10/caspnet-mailkit-mimekit_13.html

[研究][C#][ASP.NET] 寄信 (使用 MailKit 和 MimeKit)
https://shaurong.blogspot.com/2019/10/caspnet-mailkit-mimekit_11.html

[研究][C#][ASP.NET] 加簽寄信 (使用 System.Net.Mail.MailMessage)
https://shaurong.blogspot.com/2019/10/caspnet-systemnetmailmailmessage.html
更新補充一些資訊,更新到 2021-11-29

********************************************************************************

環境:Visual Studio 2019
NuGet 要安裝 MailKit 和 System.Data.SQLite

注意:certdb.sqlite 要加入方案中,deploy 才會出去。

Web.Config 部分

<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<appSettings>
		<add key="EmailCertificateSN" value="郵件憑證序號" />
	</appSettings>
</configuration>




using MailKit.Net.Smtp;
using MailKit.Security;
using MimeKit;
using MimeKit.Cryptography;
using System;
using System.Data.SQLite;
using System.IO;
using System.Linq;
using System.Security.Cryptography.X509Certificates;

namespace WebApplication2
{
    // http://www.mimekit.net/docs/html/Working-With-SMime.htm
    public class MySecureMimeContext : DefaultSecureMimeContext
    {
        //public MySecureMimeContext()
        //    : base(OpenDatabase("C:\\wherever\\certdb.sqlite"))
        //{}

//        public MySecureMimeContext(): //base(OpenDatabase(@"C:\CodeTemp\WebApplication2\WebApplication2\certdb.sqlite"))
//        {}

        static string dbPath = HttpContext.Current.Server.MapPath("/App_Data/");
        public MySecureMimeContext() : base(OpenDatabase(dbPath + "certdb.sqlite"))
        { }

        static IX509CertificateDatabase OpenDatabase(string fileName)
        {
            var builder = new SQLiteConnectionStringBuilder();
            builder.DateTimeFormat = SQLiteDateFormats.Ticks;
            builder.DataSource = fileName;

            if (!File.Exists(fileName))
                SQLiteConnection.CreateFile(fileName);

            var sqlite = new SQLiteConnection(builder.ConnectionString);
            sqlite.Open();

            return new SqliteCertificateDatabase(sqlite, "password");
        }
    }
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
         
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            // http://www.mimekit.net/docs/html/Creating-Messages.htm
            var message = new MimeMessage();
            message.From.Add(new MailboxAddress("xxxx", "有申請憑證的@test.com"));
            message.To.Add(new MailboxAddress("yyy", "yyy@mail2000.com.tw"));
            message.Subject = "Mail2000 send Test (vis IIS SMTP localhost)";

            message.Body = new TextPart("plain")
            {
                Text = @"Hey Alice,

What are you up to this weekend? Monica is throwing one of her parties on
Saturday and I was hoping you could make it.

Will you be my +1?

-- Joey
"
            };

            // http://www.mimekit.net/docs/html/Working-With-SMime.htm

            // Note: by registering our custom context it becomes the default S/MIME context
            // instantiated by MimeKit when methods such as Encrypt(), Decrypt(), Sign(), and
            // Verify() are used without an explicit context.

            CryptographyContext.Register(typeof(MySecureMimeContext));

            X509Store store = new X509Store("My", StoreLocation.LocalMachine);

            store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);

            //如果新舊憑證都尚未過期,會抓到舊的憑證
             //X509Certificate2 signCert = store.Certificates.Find(X509FindType.FindBySubjectName, "憑證名稱", false)[0];

            // 抓 Web.Config 中設定的Email憑證序號           
            setting = ConfigurationManager.AppSettings["EmailCertificateSN"];
            string emailCertificateSN = setting.ToString();
            //用 Email憑證序號抓比較不會抓錯
           X509Certificate2 signCert = store.Certificates.Find(X509FindType.FindBySerialNumber, emailCertificateSN, false)[0];


// X509Certificate2 signCert = store.Certificates.Find(X509FindType.FindByThumbprint, "12339f33449f0cc767feb69e6dc2774ce10c1f60", false)[0];

            // VS 2019 中正常,deploy 後執行,出現錯誤「機碼組不存在」
           // 要用 MMC 設定 Email 憑證可讓 IIS_IUSRS 存取
            CmsRecipient recipient = new CmsRecipient(signCert);

            CmsRecipientCollection colle = new CmsRecipientCollection();
            colle.Add(recipient);

            using (var ctx = new MySecureMimeContext())
            //using (var ctx = new TemporaryMimeContext())
            {
                // Note: this assumes that the Sender address has an S/MIME signing certificate
                // and private key with an X.509 Subject Email identifier that matches the
                // sender's email address.
                var ctxsender = message.From.Mailboxes.FirstOrDefault();

                CmsSigner signer = new CmsSigner(signCert);
                message.Body = MultipartSigned.Create(ctx, signer, message.Body);
                //var signed = MultipartSigned.Create(ctx, signer, message.Body);

                //var encrypted = ApplicationPkcs7Mime.Encrypt(ctx, colle, signed);

                //message.Body = MultipartSigned.Create(ctx, signer, encrypted);
                //message.Body = MultipartSigned.Create(ctx, signer, signed);


                // MimeKit.Cryptography.CertificateNotFoundException
                // A valid signing certificate could not be found.
                //message.Body = MultipartSigned.Create(ctx, ctxsender, DigestAlgorithm.Sha1, message.Body);
            }

            // http://www.mimekit.net/docs/html/M_MailKit_Net_Smtp_SmtpClient__ctor.htm
            using (var client = new SmtpClient())
            {
                //  IIS SMTP 要設定 None,Auto 會失敗
                //client.Connect("localhost", 25, SecureSocketOptions.None);

                client.Connect("localhost", 25, SecureSocketOptions.Auto);

                //client.Authenticate("zzzz@gmail.com", "密碼");

                try
                {
                    //foreach (var message in messages)
                    //{
                    client.Send(message);
                //}
             
                    client.Disconnect(true);
                    Label1.Text = "成功寄出。";
                }
                catch (Exception ex)
                {
                    if (ex!=null)
                    {
                        Label1.Text = ex.Message.ToString();
                    }
                    else
                    {
                        Label1.Text = "不明錯誤。";
                    }
                }
            }
        }
    }
}






********************************************************************************
若出現錯誤:
無法加載 DLL「SQLite.Interop.DLL」: 找不到指定的模塊。 (異常來自 HRESULT:0x8007007E)。






********************************************************************************
若 deploy 程式碼失敗,出現錯誤

2020/1/21 下午 03:22:17
System.AggregateException: 發生一或多項錯誤。 ---> System.Exception: 建置失敗。如需詳細資料,請查看 [輸出] 視窗。
   --- 內部例外狀況堆疊追蹤的結尾 ---
   於 System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   於 System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   於 Microsoft.WebTools.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass43_0.<PublishAsync>b__3()
   於 System.Threading.Tasks.Task`1.InnerInvoke()
   於 System.Threading.Tasks.Task.Execute()
--- 先前擲回例外狀況之位置中的堆疊追蹤結尾 ---
   於 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   於 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   於 Microsoft.Publish.Framework.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__213.MoveNext()
---> (內部例外狀況 #0) System.Exception: 建置失敗。如需詳細資料,請查看 [輸出] 視窗。<---

System.Exception: 建置失敗。如需詳細資料,請查看 [輸出] 視窗。

===================

若要砍掉 SQLite.Interop.dll 失敗

可先停用「World Wide Web Publishing 服務」,就可以砍掉。


********************************************************************************
問題:機碼組不存在

解決:因為 IIS 沒有憑證存取權限,給它權限。














********************************************************************************

(完)

相關

mimekit - 在MimeKit上,簽名和加密
http://hant.ask.helplib.com/mimekit/post_4274560

MailKit Documentation - Creating messages
http://www.mimekit.net/docs/html/Creating-Messages.htm
有簡單寄信範例 (但沒有加簽)

MailKit Documentation - Digitally Signing Messages using S/MIME
http://www.mimekit.net/docs/html/Working-With-SMime.htm#Sign

.NET Framework 中過時的類型
https://docs.microsoft.com/zh-tw/dotnet/framework/whats-new/obsolete-types
System.Web.Mail.SmtpMail 過時,建議的替代做法是 System.Net.Mail.SmtpClient。

System.Net.Mail.SmtpClient
https://docs.microsoft.com/zh-tw/dotnet/api/system.net.mail.smtpclient?view=netframework-4.8
System.Net.Mail.SmtpClient 淘汰,建議改用 https://github.com/jstedfast/MailKit 和 https://github.com/jstedfast/MimeKit

GitHub - jstedfast/MailKit: A cross-platform .NET library for IMAP, POP3, and SMTP.
https://github.com/jstedfast/MailKit

GitHub - jstedfast/MimeKit: A .NET MIME creation and parser library with support for S/MIME, PGP, DKIM, TNEF and Unix mbox spools.
https://github.com/jstedfast/MimeKit

[研究][C#][ASP.NET] 加簽寄信 (使用 System.Net.Mail.MailMessage)
https://shaurong.blogspot.com/2019/10/caspnet-systemnetmailmailmessage.html

[研究][C#]加密加簽寄信(使用Cpi.Net.SecureMail)(一)
http://shaurong.blogspot.com/2017/02/ccpinetsecuremail.html

[研究][C#]加密加簽寄信(使用Cpi.Net.SecureMail)(二)
http://shaurong.blogspot.com/2017/02/ccpinetsecuremail_13.html

[研究][C#][ASP.NET] IIS SMTP 寄信失敗,拒絕存取路徑
https://shaurong.blogspot.com/2019/10/caspnet-iis-smtp.html

[研究] [ASP.NET] [C#] [WebForm] 寄信問題
http://shaurong.blogspot.com/2017/06/aspnet-c-webform.html

An S/MIME Library for Sending Signed and Encrypted E-mail
Pete Everett, 15 Jul 2010
https://www.codeproject.com/Articles/41727/An-S-MIME-Library-for-Sending-Signed-and-Encrypted

ASP.NET寄發加密加簽信件
https://www.nccst.nat.gov.tw/ArticlesDetail?lang=zh&seq=1160

Cpi.Net.SecureMail
https://www.codeproject.com/script/Content/ViewAssociatedFile.aspx?rzp=%2FKB%2Fsecurity%2FCPI_NET_SecureMail%2F%2FCpi.Net.SecureMail_src.zip&zep=Cpi.Net.SecureMail_src%2FCpi.Net.SecureMail%2FSecureMailMessage.cs&obid=41727&obtid=2&ovid=5

如何透過 .NET 送出一個包含 S/MIME 簽章的郵件
2009/06/06 21:20
https://blog.miniasp.com/post/2009/06/06/How-to-send-s-mime-email-using-net


2019年10月9日 星期三

[研究][C#][ASP.NET] 加簽寄信 (使用 System.Net.Mail.MailMessage)

[研究][C#][ASP.NET] 加簽寄信 (使用 System.Net.Mail.MailMessage)

2019-09-30
2020-01-16 更新 Server.MapPath 問題
2022-06-06 Email憑證建議改用憑證序號抓

********************************************************************************
相關3篇

[研究][C#][ASP.NET] 加簽寄信 (使用 MailKit 和 MimeKit)
https://shaurong.blogspot.com/2019/10/caspnet-mailkit-mimekit_13.html

[研究][C#][ASP.NET] 寄信 (使用 MailKit 和 MimeKit)
https://shaurong.blogspot.com/2019/10/caspnet-mailkit-mimekit_11.html

[研究][C#][ASP.NET] 加簽寄信 (使用 System.Net.Mail.MailMessage)
https://shaurong.blogspot.com/2019/10/caspnet-systemnetmailmailmessage.html

********************************************************************************


本篇不需要用到 Cpi.Net.SecureMail,就可以寄加簽 ( signed mail ) 信件。
加密信 (encrypted  mail ) 有待研究。

綠色的部分依據自己情況換掉。

NuGet 要安裝 System.Security.Cryptography.Pkcs

Web.Config 部分

<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<appSettings>
		<add key="EmailCertificateSN" value="郵件憑證序號" />
	</appSettings>
</configuration>

WebApplication1.aspx.cs


using System;
using System.IO;
using System.Net.Mail;
using System.Security.Cryptography.Pkcs;
using System.Security.Cryptography.X509Certificates;
using System.Text;
//1. 先在專案中加入組件參考:System.Security
//2. 設定 using 以下兩個命名空間 System.Security 和 System.Net.Mail.MailMessage
using System.Security;
//using MailMessage = System.Web.Mail.MailMessage; ///過時
using MailMessage = System.Net.Mail.MailMessage;
using System.Net;

namespace WebApplication1
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            //3.郵件內容
            string emailContent = "Email Content";
                     
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("Content-Type: text/html; charset=\"big5\"");
            sb.AppendLine("Content-Transfer-Encoding: 8bit");
            sb.AppendLine();
            sb.AppendLine(emailContent.ToString());

            byte[] data = Encoding.GetEncoding("Big5").GetBytes(sb.ToString());

            // 4.替郵件內容做簽章(重點程式)

            // 方法1 (更換憑證方便,但密碼顯示程式中 )

            // 如果是寫在 Class1.cs 等類別程式中,HttpContext.Current 不可省略
            // string pfxPath = HttpContext.Current.Server.MapPath("/App_Data/TestEmailCert.pfx");
            //string pfxPassword = "test";
            //X509Certificate2 certificate = new X509Certificate2(pfxPath, pfxPassword);

            //ContentInfo content = new ContentInfo(data);
            //SignedCms signedCms = new SignedCms(content, false);
            //CmsSigner signer = new CmsSigner(SubjectIdentifierType.IssuerAndSerialNumber, certificate);
            //signedCms.ComputeSignature(signer);
            //byte[] signedbytes = signedCms.Encode();

            // 4方法 2 (憑證必須先匯入本機憑證儲存區,手續麻煩,但密碼不顯示程式中 )
            X509Store store = new X509Store("My", StoreLocation.LocalMachine);
            store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);

// //「憑證名稱」為「mmc / 憑證(本機電腦) / 個人 / 憑證」右邊視窗的「發給」欄位顯示的名稱。如果新舊憑證都尚未過期,會抓到舊的憑證
             // X509Certificate2 signCert = store
                .Certificates.Find(X509FindType.FindBySubjectName, "憑證名稱", false)[0];

            // 用郵件憑證序號抓
            X509Certificate2 signCert = store.Certificates.Find(X509FindType.FindBySerialNumber, emailCertificateSN, false)[0];

            setting = ConfigurationManager.AppSettings["EmailCertificateSN"];
            string emailCertificateSN = setting.ToString();

            SignedCms signedCms = new SignedCms(new ContentInfo(data), false);
            CmsSigner signer = new CmsSigner(SubjectIdentifierType.IssuerAndSerialNumber, signCert);
            signedCms.ComputeSignature(signer);
            byte[] signedbytes = signedCms.Encode();

            //5.郵件內容
            MailMessage msg = new MailMessage();
            msg.From = new MailAddress("from@example.com");
            msg.To.Add(new MailAddress("to@example.com"));
            msg.Subject = "test s/mime";
            // 千萬不要加上 msg.Body 內容,否則驗證 S/MIME 郵件時會失敗
            // msg.Body = EmailBody;

            ///6.將簽章內容加入到訊息的另一個 View 中( AlternateView ),可以「讀取 S/ MIME 郵件」的人可開啟 S/ MIME 郵件檢視,無法讀取「S/ MIME 郵件」的人也可以看到郵件。

            MemoryStream ms = new MemoryStream(signedbytes);
            AlternateView av = new AlternateView(ms,
                "application/pkcs7-mime; smime-type=signed-data;name=smime.p7m");
            msg.AlternateViews.Add(av);

            //7.寄出郵件
            SmtpClient client = new SmtpClient("localhost", 25);
            client.UseDefaultCredentials = true;
            try
            {
                 client.Credentials = new NetworkCredential("YourSmtpUserName", "YourSmtpPassword");
                client.Send(msg);
                Label1.Text = "成功。";
            }
            catch (Exception ex)
            {
                if (ex ==null)
                {
                    Label1.Text = "不明錯誤。";
                }
                else
                {
                    Label1.Text = ex.Message.ToString();
                }
            }
        }
    }
}


Email 憑證匯入本機憑證儲存區 ,請看下面這篇

[研究][C#]加密加簽寄信(使用Cpi.Net.SecureMail)(二)
http://shaurong.blogspot.com/2017/02/ccpinetsecuremail_13.html

憑證名稱請看下圖

********************************************************************************

以 Windows Server 2019 IIS SMTP 當 localhost  port 25 寄信測試。

收件者是 MAIL2000 信箱可以收到信。
收件者是 Gmail 信箱收不到到信。(畢竟 IIS SMTP 不是正式有 FQDN 的 Mail Server )
收件者是公司信箱不一定,若在公司測試,可以收到信;家中電腦測試,收不到。(可能驗證來源 IP 是否公司使用的 IP )
收件者是 "十分鐘信箱",可以收到信。

********************************************************************************
2021-11-18

System.Security.Cryptography.CryptographicException
  HResult=0x800B010A
  Message=憑證鏈結無法建立於受信任的根授權。

  Source=<無法評估例外狀況來源>
  StackTrace: 
<無法評估例外狀況堆疊追蹤>

[研究][ASP.NET]加簽寄信失敗-憑證鏈結無法建立於受信任的根授權

********************************************************************************
2021-11-19
client.Send(msg); 會被 Fortify SCA 報告有問題
client.UseDefaultCredentials = true; 之後,client.Send(msg); 之前請加上程式 

            client.UseDefaultCredentials = true;
            try
            {
                 client.Credentials = new NetworkCredential("YourSmtpUserName", "YourSmtpPassword");
                client.Send(msg);
                Label1.Text = "成功。";
            }


改為 


//Fortify SCA : Critical : Insecure Transport Mail Transmission
//需用加密連線,加上 client.UseDefaultCredentials = true; 和 client.EnableSsl = true;

// 只有 client.UseDefaultCredentials = true; 一個寄信成功,但是 Fortify SCA 會報告
client.UseDefaultCredentials = true;    // OK

// 根據驗證程序,遠端憑證是無效的。=> 會出錯,下面這一行必須註解掉
// 原因:mail server和client使用ssl連線,但ssl憑證並沒有經過認證(ex:自簽憑證 Self Signed Certifcate)
// client.EnableSsl = true;

// 解決「根據驗證程序,遠端憑證是無效的。」,不管驗證結果 true 或 false,都當 true
//ServicePointManager.ServerCertificateValidationCallback +=  (sender, cert, chain, sslPolicyErrors) => true;
//ServicePointManager.ServerCertificateValidationCallback += delegate { return true; };
System.Net.ServicePointManager.ServerCertificateValidationCallback += delegate { return true; };
client.EnableSsl = true;

try
{
    client.Credentials = new NetworkCredential("YourSmtpUserName", "YourSmtpPassword");
    client.Send(msg);
    Label1.Text = "成功。";
}


********************************************************************************
2021-11-29

System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
會被Fortify SCA報告Insecure SSL: Server Identity Verification Disabled

解法

[研究]Fortify SCA報告Insecure SSL: Server Identity Verification Disabled

********************************************************************************
2021-11-29 補

[研究][ASP.NET]不能為收取目錄傳遞方法啟用 SSL。

********************************************************************************

(完)


相關

.NET Framework 中過時的類型
https://docs.microsoft.com/zh-tw/dotnet/framework/whats-new/obsolete-types
System.Web.Mail.SmtpMail 過時,建議的替代做法是 System.Net.Mail.SmtpClient。

System.Net.Mail.SmtpClient
https://docs.microsoft.com/zh-tw/dotnet/api/system.net.mail.smtpclient?view=netframework-4.8
System.Net.Mail.SmtpClient 淘汰,建議改用 https://github.com/jstedfast/MailKit 和 https://github.com/jstedfast/MimeKit

GitHub - jstedfast/MailKit: A cross-platform .NET library for IMAP, POP3, and SMTP.
https://github.com/jstedfast/MailKit

GitHub - jstedfast/MimeKit: A .NET MIME creation and parser library with support for S/MIME, PGP, DKIM, TNEF and Unix mbox spools.
https://github.com/jstedfast/MimeKit

[研究][C#][ASP.NET] 加簽寄信 (使用 System.Net.Mail.MailMessage)
https://shaurong.blogspot.com/2019/10/caspnet-systemnetmailmailmessage.html

[研究][C#]加密加簽寄信(使用Cpi.Net.SecureMail)(一)
http://shaurong.blogspot.com/2017/02/ccpinetsecuremail.html

[研究][C#]加密加簽寄信(使用Cpi.Net.SecureMail)(二)
http://shaurong.blogspot.com/2017/02/ccpinetsecuremail_13.html

[研究][C#][ASP.NET] IIS SMTP 寄信失敗,拒絕存取路徑
https://shaurong.blogspot.com/2019/10/caspnet-iis-smtp.html

[研究] [ASP.NET] [C#] [WebForm] 寄信問題
http://shaurong.blogspot.com/2017/06/aspnet-c-webform.html

An S/MIME Library for Sending Signed and Encrypted E-mail
Pete Everett, 15 Jul 2010
https://www.codeproject.com/Articles/41727/An-S-MIME-Library-for-Sending-Signed-and-Encrypted

ASP.NET寄發加密加簽信件
https://www.nccst.nat.gov.tw/ArticlesDetail?lang=zh&seq=1160

Cpi.Net.SecureMail
https://www.codeproject.com/script/Content/ViewAssociatedFile.aspx?rzp=%2FKB%2Fsecurity%2FCPI_NET_SecureMail%2F%2FCpi.Net.SecureMail_src.zip&zep=Cpi.Net.SecureMail_src%2FCpi.Net.SecureMail%2FSecureMailMessage.cs&obid=41727&obtid=2&ovid=5

如何透過 .NET 送出一個包含 S/MIME 簽章的郵件
2009/06/06 21:20
https://blog.miniasp.com/post/2009/06/06/How-to-send-s-mime-email-using-net