javascript + activex + html

5965 단어 JavaScript
원문
<html>

<head>

    <script type='text/javascript' language='javascript'>

        function OpenOutlookNewEmail() {

            try {



                var outlookApp = new ActiveXObject("Outlook.Application");

                var nameSpace = outlookApp.getNameSpace("MAPI");

                mailFolder = nameSpace.getDefaultFolder(6);

                mailItem = mailFolder.Items.add('IPM.Note.FormA');

                mailItem.Subject = "Me";

                mailItem.To = "[email protected]";

                mailItem.HTMLBody = '<a href="http://www.baidu.com">baidu</a><img width="728" height="90" title="" alt="" src="http://static.adzerk.net/Advertisers/a61df59863ed44e59446d0b9bb805c56.jpg" border="0"/>';

                mailItem.display(0);

            }

            catch (e) {

                alert(e);

                // act on any error that you get

            }

        }



    </script>

</head>

<body>

    <a href='javascript:OpenOutlookNewEmail()'>email</a>

</body>

</html>

좋은 웹페이지 즐겨찾기