Graph module 2.26.0 for PowerShell error with internetMessageHeaders sending email
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