Comments on: How to Send SMTP Email Using PowerShell (Part 4) https://practical365.com/powershell-html-email-formatting/ Practical Office 365 News, Tips, and Tutorials Tue, 22 Nov 2022 20:57:24 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: Localnet Email - Login Information -Official Site https://practical365.com/powershell-html-email-formatting/#comment-247428 Tue, 22 Nov 2022 20:57:24 +0000 https://www.practical365.com/?p=4203#comment-247428 […] https://practical365.com/powershell-html-email-formatting/ […]

]]>
By: Justin https://practical365.com/powershell-html-email-formatting/#comment-245204 Fri, 21 Oct 2022 00:41:44 +0000 https://www.practical365.com/?p=4203#comment-245204 Well that was a head scratcher. I’m guessing the comment section is stripping HTML tags. So things like this line are blank:

$style = $style + “”

The end style tag should be in the quotes. This is why people are complaining about their “style” being in text at the top of their email.

]]>
By: Paul Wain https://practical365.com/powershell-html-email-formatting/#comment-231371 Wed, 16 Sep 2020 04:21:51 +0000 https://www.practical365.com/?p=4203#comment-231371 In reply to Harish.

The CSS is something like this for Odd/Even rows:

tr:nth-child(even) { background-color: #eee; } tr:nth-child(odd) { background-color: #fff; }

]]>
By: Harish https://practical365.com/powershell-html-email-formatting/#comment-230073 Tue, 23 Jun 2020 10:15:07 +0000 https://www.practical365.com/?p=4203#comment-230073 How to conditionally change table row color in html table by power shell command

]]>
By: Kathy https://practical365.com/powershell-html-email-formatting/#comment-228630 Mon, 06 Jan 2020 11:18:57 +0000 https://www.practical365.com/?p=4203#comment-228630 Brilliant. Thanks for posting.

]]>
By: Vinay https://practical365.com/powershell-html-email-formatting/#comment-157516 Thu, 01 Mar 2018 02:23:44 +0000 https://www.practical365.com/?p=4203#comment-157516 Hi , Can u please help me to get table in HTML format in powershell.

Thursday, March 01, 2018 6:53:02 AM

Queue status Count
BadQueue 0
HoldingQueue 0
InboundQueue 0
LanQueue 0
LocalQueue 0
RemoteQueue 0
RetryQueue 76

Diskspace Used Free
E:Drive space 1357.241749 318.1576614

]]>
By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Paul Cunningham</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_11010'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_11010"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Paul Cunningham</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/powershell-html-email-formatting/#comment-11010 Mon, 17 Oct 2016 23:22:52 +0000 https://www.practical365.com/?p=4203#comment-11010 In reply to Fabian Vega.

Maybe sharing the error message would be helpful.

]]>
By: Fabian Vega https://practical365.com/powershell-html-email-formatting/#comment-11009 Mon, 17 Oct 2016 23:08:20 +0000 https://www.practical365.com/?p=4203#comment-11009 In reply to Matt Pollock.

Hey, Matt.

I’ve tried to add this line “Send-MailMessage @smtpsettings -Body $MailBoxReport -BodyAsHTML” into sharepoint powershell function, but it returns an error. LOL

what can i do?

]]>
By: Matthew https://practical365.com/powershell-html-email-formatting/#comment-11005 Mon, 22 Feb 2016 09:53:38 +0000 https://www.practical365.com/?p=4203#comment-11005 In reply to Logan.

Hi Logan

Did Paul ever reply to you? I have a scenario where I have two tables in my message body, but the second one doesn’t seem to adhere to the formatting. Yet if I output the entire message body to and HTML file and open in a browser, it looks right. Seems like Outlook or the send-mailmessage cmdlet is doing something with the formatting.

]]>
By: Victor https://practical365.com/powershell-html-email-formatting/#comment-11004 Fri, 19 Jun 2015 08:49:57 +0000 https://www.practical365.com/?p=4203#comment-11004 In reply to fahid.

I had the same problem.
This style works for me:
$style = “”
$style = $style + “BODY{font-family: Arial; font-size: 10pt;}”
$style = $style + “TABLE{border: 1px solid black; border-collapse: collapse;}”
$style = $style + “TH{border: 1px solid black; background: #dddddd; padding: 5px; }”
$style = $style + “TD{border: 1px solid black; padding: 5px; }”
$style = $style + “”

]]>