2
votes

I want to send an Email in Sharepoint online. I used the following method to send the mail using the Event reciever.

 SPUtility.SendEmail(SPContext.Current.Web, headers, bodyText.ToString());

But it does not work with sharepoint online 2013. After reading in the articles I got to know that SPUtility method cannot be used. Please provide me a solution to send mail through event reciever. I am creating it as a Sandbox Solution.

Can we Use Microsoft Exchange Server? How Can I use it?

Thanks for the helps!

2

2 Answers

1
votes

You could use a workaround by leveraging the SendMail activity in a workflow. This is also explained here: Guru Tip: Sending an Email in Office 365.

Unfortunately using this workflow workaround will be your only choice as both SPUtility.SendEmail as well as System.Net.Mail.SmtpClient are not allowed in Sandboxed solutions which is also explained in this post: Send email via code in Office365

0
votes

How to import Emails or part of the Email data to Sharepoint libraries or Sharepoint lists you can find on "The smart way from mailbox to Sharepoint". It works fine for Sharepoint online.