Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 192300

Re: Powershell/PowerCLI Dynamic Email Message Body with Datastores

$
0
0

Send-MailMessage : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'Body'. Specified method is not supported.

My bad i did'tn check the variable type used by -Body parameter...


Replace the Send mail part by this one, it should work (but not tested)

# Send email

$MailBody = ConvertTo-HTML @params | Out-String

$ReportingMail = "esx@lab.local"

Send-MailMessage -To $Email -From $ReportingMail -Subject $MailSubject -BodyAsHtml -Body $MailBody -SmtpServer $SMTPServer


Viewing all articles
Browse latest Browse all 192300

Trending Articles



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