Thursday, September 24, 2009

SPUtility.SendEmail truncates your message body

Use this instead to send longer emails from SharePoint:

MailMessage message = new MailMessage();
message.From = new MailAddress(list.ParentWeb.Site.WebApplication.OutboundMailSenderAddress);
message.To.Add(new MailAddress(";
message.Subject = "Subject";
message.Body = "Body";
SmtpClient smtpClient = new SmtpClient(SPContext.Current.Site.WebApplication.OutboundMailServiceInstance.Server.Address);

No comments:

Restoring a lot of files from the Recycle Bin

I had a customer who accidentally synched a (very large) SP Online library and then decided they didn't want the files on their PC anymo...