How to Embed a Video in Emails Using PowerShell and Send-MgUserMail?

0
4
Asked By TechieTraveler42 On

Hey everyone! I need some help with embedding an MP4 video in an email using Powershell, specifically through the Send-MgUserMail function. Here's the situation: I can successfully copy a shareable link of an MP4 file from OneDrive/SharePoint, and it embeds nicely in the New Outlook using Microsoft's Stream app. However, I want to automate this process to send introduction videos to new users, instead of creating each email manually, and I'm currently running into issues with the embedding.

I've written a function called Send-ITOnboarding that is supposed to take care of sending these emails, but when I include the video link in the body of the email, it doesn't embed correctly, remaining just a hyperlink. I've tried various approaches including copying the embed link from Stream, but haven't had any success. Some folks mentioned that these embedding issues might be related to SMTP restrictions. Has anyone else faced this issue or have any ideas on how to get around it? Appreciate any guidance!

3 Answers

Answered By CodeWhizKid On

Don’t forget that certain versions of Outlook dynamically change the embedded HTML when sending. Try sending yourself a test email to see how it's rendered on the recipient's end and view the source. That might give you clues on what to tweak in your code.

TechieTraveler42 -

Yeah, I did notice that my code had pasted incorrectly, and I have specified ContentType as "HTML". Just checked the source again from my test email and only saw a few differences.

Answered By PowerShellPal On

I noticed you might have posted this question twice, but that could just be coincidence. However, make sure you're specifying the content type for the email correctly—this could help with the embedding issue.

TechieTraveler42 -

That's not me! But I appreciate the heads-up!

Answered By ScriptNinja99 On

You might be hitting some safety features on the recipient's email side, like blocking untrusted URLs. Just a thought! You could check if the links are getting flagged as unsafe.

CuriousCoder88 -

Hm...that might explain it.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.