Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

HTML/CSS formatting fails while sending mail from PowerShell

$
0
0

Hi All,

I'm sending the content of an HTML file through an email to other people.
Below is the code I'm using.

$body = (get-content c:\Temp.html) | out-string
Send-MailMessage -To abc@gmail.com -Subject "Report" –From xyz@adp.com -SmtpServer smtpserver -Body $Body -BodyAsHtml

HTML page when opened locally looks good.
When the mail is received by me, the format looks good.
BUT when I send email to other people, they are not getting the format in correct way.

I've applied CSS while generating HTML, which fails while sending mail to other people.
Any guess what might be the reason?

Thanks,
Pavan


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>