Graph module 2.26.0 for PowerShell error with internetMessageHeaders sending email

Damon Thomas 0 Reputation points
2025-02-21T15:58:45.7366667+00:00

I have some scripts which send email via Graph using Send-MgUserMail.

Today I upgraded the module in PowerShell (latest v7 at time of writing) to 2.26.0

When I tried to run my script I received an exception:

[RequestBodyRead] : The property 'inteetMessageHeaders' does not exist on type 'microsoft.graph.message'. Make sure to only use property names that are defined by the type or mark the type as open type."

That is NOT a typo on my behalf, that really does say "inteet" instead of "internet".

My script sets a header for the email in one place only:

$Message.InternetMessageHeaders = @(

            @{

                Name = "X-Content-Type"

                Value = "text/plain; charset=UTF-8"

            }

        )

This has worked until I upgraded the module.

If I comment out this section then the email will send.

I uninstalled the entire Graph module and reinstalled.

Same problem.

I uninstalled again and this time installed v2.25.0 and the error has gone.

I originally posted here: https://answers.microsoft.com/en-us/msoffice/forum/all/graph-module-2260-for-powershell-error-with/9538f5a9-cc93-465c-956d-8916b9a61664

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,112 questions
0 comments No comments
{count} votes

Your answer

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