i have a mail script but since changeing from windows 10 to windows 11 my script is not working anymore.
I could already figgure out that this exact step is not working (either with the ps7 or the default ps from windows 11). Previously i was using Windows 10 default ps where it was working..
that is the following code as example:
$outlook = New-Object -comObject Outlook.Application
$mail = $outlook.CreateItemFromTemplate(some_template.oft)
$mail.Display()
# opens up the mail in a window for "live" view of the change
$mail.HTMLBody = "asdasd"
# Working flawlesly, the Mail has the String in it
$body = "asdasd"
$mail.HTMLBody = $body
# not working, mail is empty
i couldnt find anything on the web or i dont have the right words for searching.
When using the $variable the operator ‘=’ is not working anymore ..
i tried with all sorts of ConvertTo or Convert From or the Out-String stuff
Maybe someone have a solution.
Best thanks
Christin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.