In the client object model for SharePoint Online we have the Utility class. This class provides a function SendEmail() that (oh wonder) helps us to send emails. In my tests, I found that the recipient must be a member of the hidden “All People” group in the SharePoint site, from where we take the client context. So, to successfully send an email with this function, the code should look like this:

string userMail = "";

Web web = ctx.Web;

EmailProperties mailProps = new EmailProperties();
mailProps.From = "";
mailProps.To = new string[] { userMail };
mailProps.Subject = "Email Tester";
mailProps.Body = @"<html><body><h1 style='color: red;'>Header</h1><br/><div>Hello world.</div></body></html>";

Utility.SendEmail(ctx, mailProps);

Very important for the recipients: they must be a user in the current tenant. In my tests, it was not possible to send emails to external users, even when they have permissions in the SharePoint site of the client context.