我如何将Outlook Web App嵌入我的网站?

时间:2022-11-30 08:49:57

I want to embed Outlook Web App into my site. Show Calendar, mail, people screens directly on pages of my site. I tried to do it via iFrame, but it is forbidden. Is it possible at all?

我想将Outlook Web App嵌入到我的网站中。在我的网站页面上直接显示日历,邮件,人物屏幕。我试图通过iFrame来做,但它是禁止的。有可能吗?

2 个解决方案

#1


1  

Contrary to common belief, this is achievable.

与普遍看法相反,这是可以实现的。

There are more details in my blogpost (http://blog.degree.no/2013/06/owa-in-iframe-yes-its-possible/) but here's the code needed. If you run it in "light mode" (flag = 1) there are less issues and it works cross domain, but if you run it within the same domain (e.g. website running on yourdomain.com and your exchange server is running on mail.yourdomain.com) it works fine for "full mode" (flag = 0) as well:

我的博文中有更多详细信息(http://blog.degree.no/2013/06/owa-in-iframe-yes-its-possible/),但这里是所需的代码。如果你在“轻量级模式”(flag = 1)中运行它的问题较少,它可以跨域工作,但如果你在同一个域内运行它(例如在yourdomain.com上运行的网站,你的交换服务器在邮件上运行)。 yourdomain.com)它也适用于“完整模式”(flag = 0):

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>

<script>
    function LoginToOWA(server, domain, username, password) {


        var url = "https://" + server + "/owa/auth/owaauth.dll";
        // flags 0 = full version, flags 1 = light weight mode
        var p = { destination: 'https://' + server + '/exchange', flags: '1', forcedownlevel: '0', trusted: '0', isutf8: '1', username: domain + '\\' + username, password: password };


        var myForm = document.createElement("form");
        myForm.method = "post";
        myForm.action = url;

        for (var k in p) {

            var myInput = document.createElement("input");
            myInput.setAttribute("name", k);
            myInput.setAttribute("value", p[k]);
            myForm.appendChild(myInput);
        }


        document.body.appendChild(myForm);
        myForm.submit();
        document.body.removeChild(myForm);
    }
</script>


<body onload="javascript:LoginToOWA('mail.someserver.com','yourdomain','yourusername@someserver.com','yourpassword');">
    <img src="../../gfx/loadingAnim.gif" /> Please wait while your inbox is loading... 
</body>
</html>

#2


0  

Which version of OWA are you having? I have done this before for our company's intranet on OWA-2003. Just point your iframe to the webpart url like this:

你有哪个版本的OWA?我之前在OWA-2003上为我们公司的内部网做过这个。只需将您的iframe指向webpart网址,如下所示:

http://server/exchange/user/inbox/?cmd=contents&view=Two-Line%20View&theme=4

This will work only if your main website uses Windows Integrated Authentication. You have to replace "user" with the logged in username using ASP.Net server-side code.

仅当您的主网站使用Windows集成身份验证时,此功能才有效。您必须使用ASP.Net服务器端代码将“user”替换为登录的用户名。

Search MS KB articles for the webpart parameters. You can show inbox, calendar etc.

在MS KB文章中搜索webpart参数。您可以显示收件箱,日历等。

#1


1  

Contrary to common belief, this is achievable.

与普遍看法相反,这是可以实现的。

There are more details in my blogpost (http://blog.degree.no/2013/06/owa-in-iframe-yes-its-possible/) but here's the code needed. If you run it in "light mode" (flag = 1) there are less issues and it works cross domain, but if you run it within the same domain (e.g. website running on yourdomain.com and your exchange server is running on mail.yourdomain.com) it works fine for "full mode" (flag = 0) as well:

我的博文中有更多详细信息(http://blog.degree.no/2013/06/owa-in-iframe-yes-its-possible/),但这里是所需的代码。如果你在“轻量级模式”(flag = 1)中运行它的问题较少,它可以跨域工作,但如果你在同一个域内运行它(例如在yourdomain.com上运行的网站,你的交换服务器在邮件上运行)。 yourdomain.com)它也适用于“完整模式”(flag = 0):

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>

<script>
    function LoginToOWA(server, domain, username, password) {


        var url = "https://" + server + "/owa/auth/owaauth.dll";
        // flags 0 = full version, flags 1 = light weight mode
        var p = { destination: 'https://' + server + '/exchange', flags: '1', forcedownlevel: '0', trusted: '0', isutf8: '1', username: domain + '\\' + username, password: password };


        var myForm = document.createElement("form");
        myForm.method = "post";
        myForm.action = url;

        for (var k in p) {

            var myInput = document.createElement("input");
            myInput.setAttribute("name", k);
            myInput.setAttribute("value", p[k]);
            myForm.appendChild(myInput);
        }


        document.body.appendChild(myForm);
        myForm.submit();
        document.body.removeChild(myForm);
    }
</script>


<body onload="javascript:LoginToOWA('mail.someserver.com','yourdomain','yourusername@someserver.com','yourpassword');">
    <img src="../../gfx/loadingAnim.gif" /> Please wait while your inbox is loading... 
</body>
</html>

#2


0  

Which version of OWA are you having? I have done this before for our company's intranet on OWA-2003. Just point your iframe to the webpart url like this:

你有哪个版本的OWA?我之前在OWA-2003上为我们公司的内部网做过这个。只需将您的iframe指向webpart网址,如下所示:

http://server/exchange/user/inbox/?cmd=contents&view=Two-Line%20View&theme=4

This will work only if your main website uses Windows Integrated Authentication. You have to replace "user" with the logged in username using ASP.Net server-side code.

仅当您的主网站使用Windows集成身份验证时,此功能才有效。您必须使用ASP.Net服务器端代码将“user”替换为登录的用户名。

Search MS KB articles for the webpart parameters. You can show inbox, calendar etc.

在MS KB文章中搜索webpart参数。您可以显示收件箱,日历等。