Comments on: Send Exchange Online Email Using the Microsoft Graph SDK for PowerShell https://practical365.com/send-mail-exchange-online-graph-powershell/ Practical Office 365 News, Tips, and Tutorials Wed, 04 Jan 2023 17:02:40 +0000 hourly 1 https://wordpress.org/?v=6.3.2 By: Tony Redmond https://practical365.com/send-mail-exchange-online-graph-powershell/#comment-250015 Wed, 04 Jan 2023 17:02:40 +0000 https://practical365.com/?p=53717#comment-250015 In reply to Scott.

You can certainly use the Graph to read text from a message (see https://practical365.com/mailbox-contents-report/ for an example of reading message content) and use that in a message.

]]>
By: Scott https://practical365.com/send-mail-exchange-online-graph-powershell/#comment-250014 Wed, 04 Jan 2023 16:56:28 +0000 https://practical365.com/?p=53717#comment-250014 Is there a way to generate an email reply from a message

]]>
By: Tony Redmond https://practical365.com/send-mail-exchange-online-graph-powershell/#comment-241641 Sun, 07 Aug 2022 13:59:42 +0000 https://practical365.com/?p=53717#comment-241641 In reply to Henri.

Sorry, I haven’t looked into how this cmdlet works.

]]>
By: Henri https://practical365.com/send-mail-exchange-online-graph-powershell/#comment-241556 Fri, 05 Aug 2022 19:12:38 +0000 https://practical365.com/?p=53717#comment-241556 Hi Tony, Thanks for your post!
Now I need to get it working for large attachments too. I know I have to do something with ‘New-MgUserMessageAttachmentUploadSession’. Do you have experience with this?

]]>
By: Tony Redmond https://practical365.com/send-mail-exchange-online-graph-powershell/#comment-238633 Thu, 26 May 2022 13:43:47 +0000 https://practical365.com/?p=53717#comment-238633 In reply to Vandrey da Trindade.

Super!

]]>
By: Vandrey da Trindade https://practical365.com/send-mail-exchange-online-graph-powershell/#comment-238631 Thu, 26 May 2022 13:14:24 +0000 https://practical365.com/?p=53717#comment-238631 In reply to Vandrey Trindade.

Tony,

I’ve managed to do it using this code:

$MailParams = @{
Subject = “Mail test”
UserId = “admin@domain.com”
Body = @{
content = “This is a test mail!”
contentType = “HTML”
}
ToRecipients = @(
@{
emailAddress = @{
address = “user1@domain.com”
}
},
@{
emailAddress = @{
address = “user2@domain.com”
}
}
)
}

Got the code from this other post from you:
https://practical365.com/upgrade-powershell-scripts-sendmailmessage/

Thanks once again!

]]>
By: Vandrey da Trindade https://practical365.com/send-mail-exchange-online-graph-powershell/#comment-238629 Wed, 25 May 2022 19:45:39 +0000 https://practical365.com/?p=53717#comment-238629 In reply to Vandrey Trindade.

Thanks a lot! At least you found a way!

]]>
By: Tony Redmond https://practical365.com/send-mail-exchange-online-graph-powershell/#comment-238628 Wed, 25 May 2022 18:44:39 +0000 https://practical365.com/?p=53717#comment-238628 In reply to Vandrey Trindade.

I wish the code was easier to write, but that’s the way we have to do it until the developers refine the cmdlet.

]]>
By: Vandrey Trindade https://practical365.com/send-mail-exchange-online-graph-powershell/#comment-238626 Wed, 25 May 2022 17:21:13 +0000 https://practical365.com/?p=53717#comment-238626 In reply to Tony Redmond.

Yes, but using your way I need to create a hash table first with all email addresses and then create another variable using a foreach-object loop.
There’s no way to write the hash table directly?

Something like:

ToRecipients = @{
emailAddress = @{
address = “user1@domain.com”, “user2@domain.com”, “user3@domain.com”
}

or

ToRecipients = @{
emailAddress = @{
address = “user1@domain.com”
},
@{
address = “user2@domain.com”
}
}

]]>
By: Tony Redmond https://practical365.com/send-mail-exchange-online-graph-powershell/#comment-238625 Wed, 25 May 2022 16:48:15 +0000 https://practical365.com/?p=53717#comment-238625 In reply to Vandrey Trindade.

Look at the code to add BCC addresses in the Handling Recipients section. The same approach works for TO and CC recipients.

]]>