Hi,
I have below Powershell script that sends an email with an Excel CSV file attached.
I would like to know what do I need to change/add on below script so that it will just scan the contents of the CSV file and throw its content to the Outlook email body, so Column, Rows and data will be on the Outlook Body instead so no need for the CSV file to be attached on the email.
And if the Excel CSV file has nothing on it, Outlook will still send email but no column, rows and data in the body (Just like a blank email body).
So it will be easier for the recipient to look on the data instead of clicking the email then clicking the CSV file attached.
Thank you
Powershell command:
Get-ChildItem "C:\PowerShell\Result.csv" | Send-MailMessage -Credential $cred -to "@gmail.com" -from "x@gmail.com" -Subject "Testing" -body "This is a Test" -SmtpServer "mailhost.xxx.xxx.com" -Priority High