There are few methods that we can use to send Emails in SharePoint Provider Hosted apps.
- Using general Email Sending method
- Using SharePoint Client Object Model (CSOM)
Using general Email Sending method
This is the general method we are using for sending email for asp.net. This is method has advantages over other two methods. this method has few advantages over other methods,
- Send attachments to the recipients
- Send emails to external users (SharePoint 2013 email function can not be used to send emails to external users)
There are many articles in available for this , I’m describing a sample code below.
For this you need to either have a smtp server setup by your self or valid authentication for the existing server.
Using SharePoint Client Object Model (CSOM)
This has been a most famous method for a sending email. You can use SharePoint Utility class to send a Email. But you can not send to external users. If you are sending to external users they should be added to your mail exchange but it will take some time to reflect the change.
You can use the same method with remote event receivers only by changing SharePoint client context initiation.