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


C# Message.AddHeaderField方法代码示例

本文整理汇总了C#中ActiveUp.Net.Mail.Message.AddHeaderField方法的典型用法代码示例。如果您正苦于以下问题:C# Message.AddHeaderField方法的具体用法?C# Message.AddHeaderField怎么用?C# Message.AddHeaderField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ActiveUp.Net.Mail.Message的用法示例。


在下文中一共展示了Message.AddHeaderField方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AppendUid

	    private void AppendUid(Message message, string response)
	    {
            var msgIdMatch = Regex.Match(response, @"UID ([0-9]+)");
            if (msgIdMatch.Success)
                message.AddHeaderField("X-MSG-UID", msgIdMatch.Groups[1].Value);
	    }
开发者ID:saxx,项目名称:Imapsy,代码行数:6,代码来源:Fetch.cs

示例2: GenerateConfirmReadMessage

        /// <summary>
        /// Generates the confirm read message.
        /// </summary>
        /// <returns></returns>
        public Message GenerateConfirmReadMessage()
        {
            Message message = new Message();

            // Inverse the recipient and sender
            message.To.Add(this.ConfirmRead);
            message.From = this.To[0];

            // Create the subject
            message.Subject = "Read: " + this.Subject;

            // Adds the original message ID
            
            message.AddHeaderField("In-Reply-To", this.MessageId);

            // Prepare the bodies

            DateTime dateReceived = this.Date;
            DateTime dateRead = DateTime.Now;

            message.BodyText.Text = string.Format(@"Your message

    To:  {0}
    Subject:  {1}
    Sent:  {2} {3}

was read on {4} {5}.", this.To[0].Email, this.Subject, dateReceived.ToShortDateString(), dateReceived.ToShortTimeString(),
                 dateRead.ToShortDateString(), dateRead.ToShortTimeString());

            message.BodyHtml.Text = string.Format(@"<P><FONT SIZE=3D2>Your message<BR>
<BR>
&nbsp;&nbsp;&nbsp; To:&nbsp; {0}<BR>
&nbsp;&nbsp;&nbsp; Subject:&nbsp; {1}<BR>
&nbsp;&nbsp;&nbsp; Sent:&nbsp; {2} {3}<BR>
<BR>
was read on {4} {5}.</FONT>
</P>", this.To[0].Email, this.Subject, dateReceived.ToShortDateString(), dateReceived.ToShortTimeString(),
                 dateRead.ToShortDateString(), dateRead.ToShortTimeString());

            // Create the repot mime part
            MimePart notificationPart = new MimePart();
            notificationPart.ContentType.MimeType = "message/disposition-notification";
            notificationPart.ContentTransferEncoding = ContentTransferEncoding.QuotedPrintable;

            notificationPart.TextContent = string.Format(@"Reporting-UA: {0}; ActiveUp.MailSystem
Final-Recipient: rfc822;{1}
Original-Message-ID: <{2}>
Disposition: manual-action/MDN-sent-manually; displayed", "domain", this.To[0].Email, this.MessageId);

            message.UnknownDispositionMimeParts.Add(notificationPart);

            // Now we return the result
            return message;
        }
开发者ID:JBTech,项目名称:MailSystem.NET,代码行数:58,代码来源:Message.cs

示例3: AppendGMailExtensions

	    private void AppendGMailExtensions(Message message, string response)
	    {
            var labelsMatch = Regex.Match(response, @"X-GM-LABELS \(([^\)]*?)\)");
	        if (labelsMatch.Success)
	            message.AddHeaderField("X-GM-LABELS", labelsMatch.Groups[1].Value);
            var msgIdMatch = Regex.Match(response, @"X-GM-MSGID ([0-9]+)");
	        if (msgIdMatch.Success)
                message.AddHeaderField("X-GM-MSGID", Int64.Parse(msgIdMatch.Groups[1].Value).ToString("x"));
	    }
开发者ID:saxx,项目名称:Imapsy,代码行数:9,代码来源:Fetch.cs


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