本文整理汇总了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);
}
示例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>
To: {0}<BR>
Subject: {1}<BR>
Sent: {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;
}
示例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"));
}