Beispiel #1
0
        public static async Task <bool> TryReplyMessageAsync()
        {
            // Create a draft message and then send it. If you send the message without first creating a draft, you can't easily retrieve
            // the message Id.

            var newMessageId = await EmailSnippets.CreateDraftAndSendAsync(
                STORY_DATA_IDENTIFIER,
                DEFAULT_MESSAGE_BODY,
                AuthenticationHelper.LoggedInUserEmail
                );

            if (newMessageId == null)
            {
                return(false);
            }

            // Find the sent message.
            var sentMessageId = await GetSentMessageIdAsync();

            if (String.IsNullOrEmpty(sentMessageId))
            {
                return(false);
            }

            // Reply to the message.
            bool isReplied = await EmailSnippets.ReplyMessageAsync(
                sentMessageId,
                DEFAULT_MESSAGE_BODY);

            return(isReplied);
        }