public static void Run()
        {
            // ExStart: SendCalendarInvitation
            /// <summary>
            /// This exmpale shows how an Exchange user can share his/her calendar with someone using the EWS client of the API.
            /// Available from Aspose.Email for .NET 6.4.0 onwards
            /// </summary>

            using (IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain"))
            {
                // delegate calendar access permission
                ExchangeDelegateUser delegateUser = new ExchangeDelegateUser("*****@*****.**", ExchangeDelegateFolderPermissionLevel.NotSpecified);
                delegateUser.FolderPermissions.CalendarFolderPermissionLevel = ExchangeDelegateFolderPermissionLevel.Reviewer;
                client.DelegateAccess(delegateUser, "*****@*****.**");

                // Create invitation
                MapiMessage mapiMessage = client.CreateCalendarSharingInvitationMessage("*****@*****.**");

                // send invitation
                MailMessageInterpretor messageInterpretor = MailMessageInterpretorFactory.Instance.GetIntepretor(mapiMessage.MessageClass);
                MailMessage            mailMessage        = messageInterpretor.InterpretAsTnef(mapiMessage);
                client.Send(mailMessage);
            }
            // ExEnd: SendCalendarInvitation
        }
Ejemplo n.º 2
0
        public static void Run()
        {
            // ExStart:CreatingTNEFFromMSG
            // The path to the File directory.
            string dataDir = RunExamples.GetDataDir_Email();

            MapiMessage            msg = MapiMessage.FromFile(dataDir + "Message.msg");
            MailMessageInterpretor mi  = MailMessageInterpretorFactory.Instance.GetIntepretor(msg.MessageClass);
            MailMessage            eml = mi.InterpretAsTnef(msg);
            // ExEnd:CreatingTNEFFromMSG
        }