Friday, March 25, 2016

SharePoint PowerShell CSOM send email

In my previous article I explained about reading a SharePoint list using SharePoint PowerShell CSOM. In this article I will simply explain how to send an email using SharePoint PowerShell CSOM. 

In order to do this, you need to have the PowerShell CSOM setup done as I have explained in my previous article

An email can be simply sent using the SendMail method of the Utility class through the following code.

$email = [String[]]($email_receiver)
$emailProperties = New-Object Microsoft.SharePoint.Client.Utilities.EmailProperties
$emailProperties.To = $email
$emailProperties.Subject = $email_subject
$emailProperties.Body = $Body
[Microsoft.SharePoint.Client.Utilities.Utility]::SendEmail($Context,$emailProperties)


Used variables along with the description are as follows.

  • $email_receiver - Received email address. This needs to be an email of a user within the organization as we are using the SendEmail method.
  • $email_subject - Subject of the email.
  • $Body - Body of the email.
  • $email - This needs to be an array contains at least one element.


13 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Much obliged, that was a truly cool read! hotmail com login

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. hotmail email login

    ReplyDelete
  5. A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. hotmail email login

    ReplyDelete
  6. So, if they like your products or services then maybe they contact you or they share their email to you. You should start playing around LinkedIn.Email List for Marketing

    ReplyDelete
  7. You delivered such an impressive piece to read, giving every subject enlightenment for us to gain information. Thanks for sharing such information with us due to which my several concepts have been cleared. sign in to Hotmail

    ReplyDelete
  8. Thanks for the valuable information and insights you have so provided here... ActiveCampaign Cons

    ReplyDelete
  9. Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our. www.hotmail.com

    ReplyDelete
  10. Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic.
    email lookup

    ReplyDelete
  11. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well.. ceo email

    ReplyDelete
  12. Best work you have done, this online website is cool with great facts and looks. I have stopped at this blog after viewing the excellent content. I will be back for more qualitative work. Login Tips

    ReplyDelete
  13. thank you for this such a good information about hotmail email login on www.hotmail.com

    ReplyDelete