Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SendMail fails with empty Message.InternetMessageHeaders collection #2208

Closed
obartelt opened this issue Nov 11, 2023 · 4 comments
Closed

SendMail fails with empty Message.InternetMessageHeaders collection #2208

obartelt opened this issue Nov 11, 2023 · 4 comments

Comments

@obartelt
Copy link

obartelt commented Nov 11, 2023

When trying to send a Message with an empty InternetMessageHeaders collection via SendMail.PostAsync (both Me and Users[id] affected), an error 400 is returned with the message that the number of internet message headers is invalid (should be less or equal to 5). When the InternetMessageHeaders property is null, the mail is sent correctly. Also affects Messages.PostAsync to create a draft.

Expected behavior: ignore the empty collection.
Version: Microsoft.Graph 5.34.0, .NET Standard 2.0 with .NET 6.0 test application

@andrueastman
Copy link
Member

Thanks for raising this @obartelt

As the error is returned by API and SDK will send data as you specify, implementing the change would need to be done from the API side. As this repo is mainly intended for SDK related feature requests, any chance you can request the feature at the link below for visibility of the API owners? It would be great if you could post back the link as a comment so that anyone else with the question may also be able to discover it and upvote it as well.

https://feedbackportal.microsoft.com/feedback/forum/ebe2edae-97d1-ec11-a7b5-0022481f3c80

@obartelt
Copy link
Author

I'm not sure that the error is generated by the API, as with the 4.x SDK, everything was working fine. I only noticed the error after switching to 5.x. Have you tested that the SDK actually sends something? Or can you tell me how to diagnose that further?

@andrueastman
Copy link
Member

Thanks for clarifying @obartelt.
Any chance you can share a sample code you were using with v4 and the code that fails with v5 to help us understand where the discrepancy could be?

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants