Free Support Forum - aspose.com

FollowUp option usage

Hi,

Is there any working example of FollowUpManager? I want to add followup to a message.

Hi Mark,


Thank you for writing to us.

Please have a look at the following code sample that attaches follow up information with a MSG and saves it. The output is as shown in the attached screenshot.

Sample Code:

MapiMessage mapi = MapiMessage.FromFile(“ForFollowUp.msg”);<o:p></o:p>

DateTime dtStartDate = DateTime.Now.AddHours(2);

DateTime dtDueDate = dtStartDate.AddDays(1);

DateTime dtReminderDate = dtStartDate.AddHours(5);

FollowUpOptions options = new FollowUpOptions("Follow Up", dtStartDate, dtDueDate, dtReminderDate);

FollowUpManager.SetFlag(mapi, options);

mapi.Save("ForFollowUp2.msg");

Hi Support,

Thats working indeed. But I have two concerns here.

- If new MapiMessage is used, it gives an error

- How can the followup information be utilized as it is utilized in Outlook

Mark

Hi Mark,


Please have a look at the following code sample that adds a follow up flag for recipient. As you can see in the attached screenshot, the follow up information is displayed in outlook to the recipient of the email message. If you have any further query/inquiry in this regard, please feel free to write to us.

Code Sample:

MailMessage mailMsg = new MailMessage();<o:p></o:p>

mailMsg.From = "AETest12@gmail.com";

mailMsg.To = "receiver@domain.com";

mailMsg.Subject = "Testing follow up option.";

mailMsg.Body = "This message will test if follow up options can be added to a new mapi message.";

MapiMessage mapi = MapiMessage.FromMailMessage(mailMsg);

mapi.SetMessageFlags(MapiMessageFlags.MSGFLAG_UNSENT); //mark this message as draft

//Add the follow up flag for receipient now

DateTime dtReminderDate = DateTime.Now.AddHours(5);

FollowUpManager.SetFlagForRecipients(mapi, "Follow up", dtReminderDate);

//Convert to Mail Message again

MailMessageInterpretor mi = MailMessageInterpretorFactory.Instance.GetIntepretor(mapi.MessageClass);

mailMsg = mi.Interpret(mapi);

SmtpClient client = GetSmtpClient();

client.Send(mailMsg);