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.


16 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. 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
  5. 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
  6. Thanks for the valuable information and insights you have so provided here... ActiveCampaign Cons

    ReplyDelete
  7. 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
  8. Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic.
    email lookup

    ReplyDelete
  9. 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
  10. 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
  11. Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks Learn how to enter your email

    ReplyDelete
  12. Superior post, keep up with this exceptional work. It's nice to know that this topic is being also covered on this web site so cheers for taking the time to discuss this! Thanks again and again! acesse a caixa de entrada do Hotmail entrar

    ReplyDelete
  13. I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... hotmail entrar

    ReplyDelete
  14. Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks best email marketing services

    ReplyDelete
  15. It is truly a well-researched content and excellent wording. I got so engaged in this material that I couldn’t wait reading. I am impressed with your work and skill. Thanks. how to send bulk mails through gmail

    ReplyDelete
  16. Welcome to the party of my life here you will learn everything about me. LinkedIn Data Extractor Software Tool

    ReplyDelete