Wednesday, October 12, 2011

PowerShell script to send mail

        $headers = New-Object System.Collections.Specialized.StringDictionary
        $headers.Add("to", "")
        $headers.Add("cc", "")
        $headers.Add("bcc", "")
        $headers.Add("from", "")
        $headers.Add("subject", "Test Email Subject")
        $headers.Add("content-type", "text/html")
        $bodyText = "Hello how are you?"
        [Microsoft.SharePoint.Utilities.SPUtility]::SendEmail($web, $headers, $bodyText)

1 comment:

  1. Success is a choice not a dream. So, work hard for it and always be open-minded. Visit my site for more information. Have a good day and keep on moving forward for that success.


How to launch a document by clicking a link to the file?

Word: <a href='ms-word:ofe|u|path/to/web/word/document.docx'>Link to document</a> Excel: <a href='ms-excel:o...