- 新建一个页面,添加Content Edit Webpart,加入如下代码
<script type="text/javascript"> function func(){ var url=getQueryStringByName("url"); var body="xxx/Lists/test/DispForm.aspx?id="+url; document.getElementById("sendmail").href="mailto:?subject=title&body="+body; document.getElementById("sendmail").click(); window.frameElement.cancelPopUp(); } function getQueryStringByName(name){ var result = location.search.match(new RegExp("[?&]" + name+ "=([^&]+)","i")); if(result == null || result.length < 1){ return ""; } return result[1]; } window.onload=func; </script> <a href="" id="sendmail">Click</a>
- 用Designer添加相应的Ribbon
Ribbon Location:Ribbon.ListForm.Display.Manage.Controls._children
Navigate to URL:xxx/send.aspx?url={ItemId}