如何在 sharepoint 2007 中显示当前用户的收件箱

发布于 2024-08-16 19:27:00 字数 303 浏览 5 评论 0原文

我找到了 此网站对于 Exchange 2003,Web 部件是这样的,但在 Exchange 2007 中,即使在用户登录后,Web 部件也会显示 Exchange 2007 owa 登录页面(而不是当前用户收件箱)。

如何在 moss 2007 中显示当前用户的 Exchange 2007 收件箱?有什么想法吗?

I found this web part for Exchange 2003, but in exchange 2007 even after user login, web part shows exchange 2007 owa login page (instead of current user inbox).

How I can show current user's exchange 2007 inbox in moss 2007? Any Idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

慕巷 2024-08-23 19:27:00

解决方案是围绕开箱即用的 OWA Web 部件创建一个包装器 Web 部件,并使用当前登录用户的电子邮件地址访问收件箱。

这是代码

PS(请注意,网络访问的地址是在此处的应用程序设置中设置的!)

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);
    }
  }
}

The solution is to create a wrapper webpart around the out of the box OWA webpart and have that access the inbox by using the currently logged in user's emailaddress.

Here's the code

P.S. (note that the address of the webaccess is set in the appsettings here!)

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);
    }
  }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文