An alternative approach is to use outlook activeX control to create the message and the link, thereby preserving the full link. The disadvantage of this method is that it requires Microsoft Outlook (any version, but not outlook express) and that it requires that the browser allows running activeX controls on the site (register the site as a safe site on the clients). Although it has drawbacks, it is my belief that most SharePoint users have outlook, and it is a recommended best practice to register the company internal portal as safe anyway. With this in mind, attached is my recommended version of code to accomplish the task.
Sample Code: *Before changing the ows.js file, please back it up. The following code is to be inserted into the ows.js file of the SharePoint machine (either WSS only or SPS machine). This causes all document libraries to have the new menu item. The code sample needs to be inserted into the AddDocLibMenuItems function. The exact location can change – depending on where you want the menu item to be. It should be after the line that starts with “var currentItemEscapedFileUrl”.
Sample Code 2: *Before changing the ows.js file, please back it up. If you are unsure how and where to insert the code above, just copy the code below to replace the AddDocLibMenuItems function in your ows.js file. This will be simpler if you are unsure what to do.