How to Send email to External users in SharePoint online using CSOM?

Hello SharePointers,

Below is the CSOM code to send email to External users in SharePoint online using CSOM

string Url = “”;
var cc = new ClientContext(Url);
string passwordPlainText = “userpassword”;
string currentUserLoginName = “”;
var passWord = new SecureString();
foreach (char c in passwordPlainText.ToCharArray()) passWord.AppendChar(c);
cc.Credentials = new SharePointOnlineCredentials(currentUserLoginName, passWord);


var emailProperties = new EmailProperties();
//Email of authenticated external user
emailProperties.To = new string[] { “” };

emailProperties.Body = “This is the email body”;
emailProperties.Subject = “This is the email subject”;
Utility.SendEmail(clientContext, emailProperties);


Happy SharePointing 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *