Replies: 1 comment 4 replies
-
Hi Ofer Hope this helps below - you need to join the $members.Email array into one string using -Join "," then I have showed you how to use HTML in emails so you can use new line and any other html formatting you like: $email = @"
<!DOCTYPE html>
<html>
<body>
<h1>My Email</h1>
<p>My first paragraph.<br />
New line here.</p>
</body>
</html>
"@
$group = Get-PnPMicrosoft365Group -Identity "Your Group"
$members = Get-PnPMicrosoft365GroupMembers -Identity $group
Send-PnPMail -To ($members.Email -join ",") -Subject "Test Email" -Body $email Thanks |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
for some reason I can't figure out how to create
-To <String[]>
from an array I make from the members of Microsoft365Groupsends email only to the first address in the array
Also I can't get the body to be multi line
I add `n at the end of each sentence but it does not do it,
I also tried "<br/>" (with the &xx;) at the end but it just shows "<br/>"
Beta Was this translation helpful? Give feedback.
All reactions