2

I need to know if there is a way, or if there is going to be a way, that its possible to send emails to external users from a Sharepoint 2016 Add-in.

I have found quite a few posts saying this was possible in 2010 but since 2013 the functionality has been blocked. Seems to me that blocking this function is a step backwards.

1

I agree it is inconvenient, but they've probably thought it will be too easy to create a SpamBot Add-In the SharePoint owner has no control over.

So, from SharePoint Add-In, you need to use external email service provider in order to send out email to external users as it is not possible via SharePoint CSOM/JSOM.

Just a sample in C# as email sending is nearly equally trivial using native methods.

MailMessage mail = new MailMessage("from@mail.com", "to@mail.com");
SmtpClient client = new SmtpClient();
client.Port = 25;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Host = "smtp.google.com";
mail.Subject = "this is a test email.";
mail.Body = "this is my test email body";
client.Send(mail);

Usually that should not be a problem as there are free services for low volume usage such as SendGrid (not endorsing, just happen to know it as have been using it via Azure). Or many hosters, where you host your add-in in will provide their own SMTP servers to send the email through. Or if it is internal company system and add-in, they surely have their own SMTP servers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.