コード例 #1
0
 internal Mail(IHeader header)
 {
     _message = new MailMessage();
     Header = header;
     Headers = new Dictionary<string, string>();
     TextTransferEncoding = TransferEncoding.SevenBit;
     HtmlTransferEncoding = TransferEncoding.SevenBit;
 }
コード例 #2
0
 public void TestAddHeader()
 {
     var test = new Header();
     test.AddSubVal("foo", new List<string> { "a", "b" });
     var mime = new MailMessage();
     test.AddHeader(mime);
     var result = mime.Headers["x-smtpapi"];
     Assert.AreEqual("{\"sub\" : {\"foo\" : [\"a\", \"b\"]}}", result);
 }
コード例 #3
0
 /// <summary>
 /// Attaches the SendGrid headers to the MIME.
 /// </summary>
 /// <param name="mime">the MIME to which we are attaching</param>
 public void AddHeader(MailMessage mime)
 {
     mime.Headers.Add(SendGridHeader, AsJson());
 }