如何显示当前用户的收件箱中的SharePoint 2007(how to show current

2019-10-19 01:10发布

我发现这个网络的一部分的Exchange 2003,但即使用户登录后Exchange 2007中,Web部件显示Exchange 2007 OWA登录页面(而不是当前用户的收件箱)。

我怎么能显示当前用户的Exchange 2007在MOSS 2007收件箱? 任何想法?

Answer 1:

该解决方案是创建围绕开箱OWA web部件的包装的WebPart,并有通过使用当前登录的用户的访问EMAILADDRESS的收件箱。

下面的代码

PS(请注意,在WebAccess的地址在AppSettings的设置在这里!)

using System;
using System.Configuration;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Portal.WebControls;

namespace DCubed.SharePoint.WeParts
{
  /// <summary>
  /// Wrapper around the My Inbox WebPart
  /// </summary>
  public class MyInboxEx : WebPart
  {
    /// <summary>
    /// Called by the ASP.NET page framework to notify server controls that use     composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
    /// </summary>
    protected override void CreateChildControls()
    {
      // Create the instance of My Inbox Web Part 
      var inbox = new OWAInboxPart
      {
        MailboxName = SPContext.Current.Web.CurrentUser.Email,
        OWAServerAddressRoot = ConfigurationManager.AppSettings["MailServer"]
      };
      Controls.Add(inbox);
    }
  }
}


文章来源: how to show current user's inbox in sharepoint 2007