最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How i can embed Outlook Web App into my site? - Stack Overflow

programmeradmin3浏览0评论

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?

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?

Share Improve this question asked Jul 4, 2013 at 13:53 antant 1,1373 gold badges12 silver badges24 bronze badges 2
  • Have you seen this Outlook Integration – huMpty duMpty Commented Jul 4, 2013 at 14:06
  • I think it it not that i mean. I don't want to implement outlook portal from scratches. I just want to show default Outlook Web Application on page of my site. – ant Commented Jul 4, 2013 at 14:15
Add a ment  | 

2 Answers 2

Reset to default 2

Contrary to mon 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. and your exchange server is running on mail.yourdomain.) it works fine for "full mode" (flag = 0) as well:

<!DOCTYPE html>
<html xmlns="http://www.w3/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.','yourdomain','[email protected]','yourpassword');">
    <img src="../../gfx/loadingAnim.gif" /> Please wait while your inbox is loading... 
</body>
</html>

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

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.

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

发布评论

评论列表(0)

  1. 暂无评论