I have an csv file which contains a field named "Primary Owner" and it contains email id's of users. I would like to send email to those users in single email using powershell. How can i do that.
Normally i will define the users in To section like below.. but here, the ccsv file content will change in each time
$to = "firstname.lastname@example.org","email@example.com"
Send-MailMessage -SmtpServer server1 -To $to -From $from -Subject $subject -Body $body -BodyAsHtml
You would need to use Import-CSV to read in your CSV file and then loop through the records using a ForEach-Object something like:
You must be logged in to reply to this topic.