Azure Add-in Send Email SharePoint Online Office 365
Check out Best Alternative to InfoPath -> Try Now
This SharePoint tutorial, we will discuss how to send email in Azure add-in in SharePoint Online Office 365.
It’s a very common requirement to send email through custom code when we design and develop an application.
In general for the custom web part in SharePoint 2013, we can use the internal organization SMTP address to send an email notification through code. In the Azure-hosted solution in SharePoint Online, we have to follow the below approach to send Emails.
We will need a cloud-only account created in Office 365 Online Exchange without Multifactor authentication enabled.
The account will be used in the Azure app to send an email to connect directly to Office 365 using the SMTP client submission endpoint “smtp.office365.com” and establish the connection.
We will have to use the Cloud Only account and password provided in code to connect “smtp.office365.com”
Below code snippet for further reference.
SmtpClient clt = new SmtpClient(); clt.UseDefaultCredentials = false; clt.Credentials = new System.Net.NetworkCredential("O365 cloud only user account", "Password"); clt.Port = 587; clt.Host = "smtp.office365.com"; clt.DeliveryMethod = SmtpDeliveryMethod.Network; clt.EnableSsl = true;
You may like following SharePoint tutorials:
- SharePoint Online: Create term sets and apply as Global Navigation in Sites using PowerShell
- SharePoint 2013 workflow issues and fixes
- Design SharePoint Online Form using FORM7
- Office 365 Quick Development Design Tips and Tricks
- Show SharePoint Survey Friendly message using jQuery
- Content Query web part Group by Column in SharePoint Online Office 365
- Office 365 SharePoint Easy Migration
- Design Manager Issue with Content Type SharePoint 2013 Office 365
- SharePoint 2010 to 2013 migration Custom New Folder in Ribbon Disabled
- Create Promoted Links App in SharePoint 2013/2016 using PowerShell
- Create List and respective fields programmatically in SharePoint Online using PowerShell
- Get List Items using SPServices in SharePoint 2013 Online Office 365
We learned here how to send email in Azure add-in in SharePoint Online Office 365.
Download SharePoint Online Tutorial PDF FREE!
Get update on Webinars, video tutorials, training courses etc.