当前位置: 首页>>代码示例>>C#>>正文


C# Message.StoreToFile方法代码示例

本文整理汇总了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);
        }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:18,代码来源:MessageDeserializationTest.cs

示例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");
        }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:24,代码来源:MailBoxManager.Test.cs

示例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");
        }
    }
开发者ID:JBTech,项目名称:MailSystem.NET,代码行数:20,代码来源:Composer.aspx.cs


注:本文中的ActiveUp.Net.Mail.Message.StoreToFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。