# Sendind compare-object's result by mail

**URL:** <https://forums.powershell.org/t/sendind-compare-objects-result-by-mail/16266>\
**Category:** PowerShell Help\
**Created:** [April 16, 2021, 7:38am UTC](https://forums.powershell.org/t/sendind-compare-objects-result-by-mail/16266 "2021-04-16T07:38:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ali.Tassoit](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@Ali.Tassoit](https://forums.powershell.org/u/Ali.Tassoit)\
**Post date:** [April 16, 2021, 7:38am UTC](https://forums.powershell.org/t/sendind-compare-objects-result-by-mail/16266/1 "2021-04-16T07:38:24Z")

</div>

Hi, I want to send a result of compare-object(Differences) by mail. How can I do this ?

Thank you

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [April 16, 2021, 9:02am UTC](https://forums.powershell.org/t/sendind-compare-objects-result-by-mail/16266/2 "2021-04-16T09:02:02Z")

</div>

Ali,

with the cmdlet [Send-MailMessage](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view=powershell-7.1). Please read the help completely including the examples to learn how to use it.

---

<div class="post-metadata">

**Author:** ![rob-simmers](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/rob-simmers/32/1010_2.png) [@rob-simmers](https://forums.powershell.org/u/rob-simmers)\
**Post date:** [April 16, 2021, 1:17pm UTC](https://forums.powershell.org/t/sendind-compare-objects-result-by-mail/16266/3 "2021-04-16T13:17:56Z")

</div>

Also, you should leverage ConvertTo-HTML and when using Send-MailMessage, use the -BodyAsHtml switch. There are many posts in this forum on these cmdlets and topics:

[Send output of “Search-ADAccount” as body variable in SEND-MailMessage - PowerShell Help - PowerShell Forums](https://forums.powershell.org/t/send-output-of-search-adaccount-as-body-variable-in-send-mailmessage/5842)

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:26pm UTC](https://forums.powershell.org/t/sendind-compare-objects-result-by-mail/16266/4 "2024-05-16T20:26:43Z")

</div>


