SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to implement an email icon on the pages of our SharePoint 2010 site collection; when the user clicks it, a Lightbox-style popup allows the user to email the current URL with a custom message to someone.

It would be great to have fields for the sender's name ("Alex" for example) and a field for the body of the message that has the page's title. This might require jQuery. Has anyone done something like this? Thanks.

share|improve this question
up vote 2 down vote accepted

You can develop application page and 'pop it up' by using Dialog framework on button/icon/link click event you included in masterpage (or where you need it).

In application page you add textbox for body and on PageLoad you set it's default value (current page URL):

  protected override void OnLoad(EventArgs e)
     textBoxBody.Text = System.Web.HttpContext.Current.Request.Url;

You also add textboxes for mail address of recipient and subject (if needed) as well as additional Send button:

 <asp:button ID="SendMail" runat="server" Text="Send" OnClick="SendUrlinMail" />

And in application page code behind:

 protected void SendUrlinMail(object sender, EventArgs e)
    SPUtility.SendEmail(SPContext.Current.Web, false, false, 
             textBoxTo.text, textBoxSubject.text, textBoxBody.Text);

Since you are using SPContext.Current.Web from field of your message will be current users mail (if exist) - this is something I can only verify by experience (!)

This is simplest solution I can think of. Sry - no jQuery :)

share|improve this answer

You can do this with a feature and a custom action.

I found something like what you need here:

share|improve this answer
+1 because you are linking answer provided by our moderator :) but this is 2007 solution! – Vedran Rasol Sep 29 '11 at 8:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.