hi,
Can any one suggest on below.
unable to send email more then one user at a time using below PowerShell. Giving below error
"Item has already been added. Key in dictionary: 'to' Key being added: 'to'
[string]$bodyText=""
$bodyText = "Dear ,"
$bodyText+="`n"
$bodyText+="Please find below"
$bodyText+="`n"
$bodyText+="Thanks and Regards."
$headers = New-Object System.Collections.Specialized.StringDictionary
$headers.Add("to", "Test@domain.com")
$headers.Add("to", "Test2@domain.com")
$headers.Add("from", "Test@domain.com")
$headers.Add("subject", "Details - new line not working.")
$headers.Add("content-type", "text/html")
[Microsoft.SharePoint.Utilities.SPUtility]::SendEmail($web, $headers, $bodyText)
Thanks & Regards, Krishna