Wednesday, October 12, 2011

PowerShell script to send mail

        $headers = New-Object System.Collections.Specialized.StringDictionary
        $headers.Add("to", "test1@abc.com")
        $headers.Add("cc", "test2@abc.com")
        $headers.Add("bcc", "test3@abc.com")
        $headers.Add("from", "test@test.com")
        $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.

    triciajoy.com

    www.triciajoy.com

    ReplyDelete

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...