Share via

MSGraph C# SDK: Forwarding email with encrypted/signed pdf attachments fails

Martin Alabaster 1 Reputation point
2022-09-15T16:36:28.223+00:00

Emails with attachments showing as smime.p7m cannot be forwarded using the code example

var toRecipients = new List<Recipient>()  
                                    {  
                                        new Recipient  
                                        {  
                                            EmailAddress = new EmailAddress  
                                            {  
                                                Name = msgip.ExceptionsForwardTo.Substring(0,msgip.ExceptionsForwardTo.IndexOf("@")),  
                                                Address = msgip.ExceptionsForwardTo  
                                            }  
                                        }  
                                    };  
                                    var graphClient = getGraphClient(msgip);  
                                    await graphClient   
                                        .Users[targetAccount].Messages[theMessage.Id]  
                                        .Forward(toRecipients, null, comment)  
                                        .Request(hdrOptions)  
                                        .PostAsync();  

Error message is ErrorItemNotFound Message: The specified object was not found in the store., Cannot open attachment. Inner error:

Is this a bug?

Microsoft Security | Microsoft Graph
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.