I'm trying to send an email with an HTML attachment using PowerShell, but I'm running into an error that says my attachment data is corrupted because the property value is too big. Here's the specific error message:
"Send-MgUserMail : The object data is corrupted. The value of property AttachLongFileName is too large and requires streaming. Status: 400 (BadRequest) ErrorCode: ErrorPropertyTooBig"
I've shared my script below, which generates an HTML file from a CSV. I'm not sure if the issue is related to how I'm defining the file name or the content itself. Any help would be appreciated!
2 Answers
From the error, it seems like the attachment file size might exceed some limits. How large is your generated file? If it’s beyond the limits set by your Exchange server, that could be the issue. Also, double-check that the `$file` variable is properly set for the attachment.
Hey! It looks like your variable `$file` for the attachment name is never actually defined in your script. Make sure to set that somewhere so it knows what file to attach.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically