public static void Run()
{
// The path to the File directory.
string dataDir = RunExamples.GetDataDir_Email();
string dstDraft = dataDir + "appointment-draft_out.msg";
string sender = "[email protected]";
string recipient = "[email protected]";
MailMessage message = new MailMessage(sender, recipient, string.Empty, string.Empty);
Appointment app = new Appointment(string.Empty, DateTime.Now, DateTime.Now, sender, recipient);
app.Method = AppointmentMethodType.Publish;
message.AddAlternateView(app.RequestApointment());
MapiMessage msg = MapiMessage.FromMailMessage(message);
// Save the appointment as draft.
msg.Save(dstDraft);
Console.WriteLine(Environment.NewLine + "Draft saved at " + dstDraft);
}
}