Saturday, May 15, 2010

Send To Email with Attachment

Sending emails with a Sharepoint document as an attachment is a commonly asked for feature in Sharepoint.
Although the mailto: link used to work with the attachment parameter, this has not been supported by Outlook for a long time. Why? because it would be too easy to attach viruses to emails that way. Outlook would have to download a file from the internet and add it to the message. The chance of malicious code injecting into the process is too risky as well as the chance to send infected files to friends and colleagues.

So what is the solution?

If you wish to extend the send to menu in SharePoint, you can create a feature with a custom action to add another link to the ECM (Context Menu) which opens up a custom application page which then allows the user to enter receiver, subject and body. The server then could send the email directly via the configured SMTP server.

But beware!
This should only be done in an intranet scenario where the sending user has been authenticated. Otherwise it could be abused for spamming purposes too easily

Saturday, May 1, 2010

SharePoint Memory Leak

Todd Carter has posted a great article on a nasty little memory leak in SharePoint which has the potential to blow into a huge memory consumption beast for servers which have a lot of traffic and long uptime.
In his article he highlights a problem with the HttpApplicatinoException handling of Sharepoint and also posts a very simple and effective solution where he ensures the applicationdomain is treated like a singleton and circumvents tens of thousands of unneeded objects in memory.
Sasquatch-Memory Leak