本文整理汇总了C#中ActiveUp.Net.Mail.Message.StoreToFile方法的典型用法代码示例。如果您正苦于以下问题:C# Message.StoreToFile方法的具体用法?C# Message.StoreToFile怎么用?C# Message.StoreToFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActiveUp.Net.Mail.Message
的用法示例。
在下文中一共展示了Message.StoreToFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrepareMessageForSerialization
public void PrepareMessageForSerialization()
{
var test_mail = new Message
{
From = { Email = "[email protected]", Name = Codec.RFC2047Encode("test") },
To = { new Address { Email = "[email protected]", Name = Codec.RFC2047Encode("name1") },
new Address { Email = "[email protected]", Name = Codec.RFC2047Encode("name2") } },
Subject = Codec.RFC2047Encode("test"),
BodyText = { Charset = utf8_charset,
ContentTransferEncoding = ContentTransferEncoding.QuotedPrintable,
Text = "test" },
BodyHtml = { Charset = utf8_charset,
ContentTransferEncoding = ContentTransferEncoding.QuotedPrintable,
Text = "<a href='www.teamlab.com'>test</a>" }
};
test_mail.StoreToFile(TestFilePath);
}
示例2: TestPrepareMessage
public static void TestPrepareMessage()
{
var charset = Encoding.UTF8.HeaderName;
const string text = "тест";
const string html = "<a href='www.teamlab.com'>" + text + "</a>";
var message = new Message
{
From = {Email = "[email protected]", Name = Codec.RFC2047Encode(text)}
};
message.To.Add("[email protected]", Codec.RFC2047Encode(text));
message.Subject = Codec.RFC2047Encode(text);
message.BodyText.Charset = charset;
message.BodyText.ContentTransferEncoding = ContentTransferEncoding.QuotedPrintable;
message.BodyText.Text = text;
message.BodyHtml.Charset = charset;
message.BodyHtml.ContentTransferEncoding = ContentTransferEncoding.QuotedPrintable;
message.BodyHtml.Text = html;
message.StoreToFile(@"test_send_prepared.eml");
}
示例3: saveSentMail
private void saveSentMail(Message message)
{
try
{
string path = Path.Combine(Path.GetTempPath(), Constants.SENT_MAILS_FOLDER);
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
message.StoreToFile(Path.Combine(path, Guid.NewGuid().ToString()));
}
catch (Exception)
{
Session["ErrorMessage"] = "The message could not save into SentMail";
Response.Redirect("~/ErrorPage.aspx");
}
}