?
Solved

Javascript button to open Outlook (12) 2007 New message

Posted on 2009-05-06
3
Medium Priority
?
1,682 Views
Last Modified: 2012-05-06
Hello the code below was made for a button to open a new outlook message prior to Outlook 12 ( 2007 ). Is there a way to modify this to make work with 2007?

Thanks advance.
<script language="JavaScript" type="text/JavaScript">
 
function genNewEmail()
 
{
 
  try
 
  {
 
    o = new ActiveXObject("Outlook.Application");
 
    if(o)
 
    {
 
      mailFolder = o.getNameSpace("MAPI").getDefaultFolder(6);
 
 
 
      //You could also use custom forms like IPM.Note.CustomForm
 
      mailItem = mailFolder.Items.add("IPM.Note");
 
      mailItem.Display(0)
 
    }
 
  }
 
  catch(e)
 
  {
 
    window.status = e.Message;
 
  }
 
}
 
</script>
 
 
 
<input type="button" value="New Message" NAME="cmdNewMessage" OnClick="genNewEmail()">

Open in new window

0
Comment
Question by:colonelblue
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Accepted Solution

by:
ziffgone earned 750 total points
ID: 24331182
Well, if Outlook is your default email client, you could simply go with this:


<script type="text/javascript">
top.location.href="mailto:user@domain.tld";
</script>

Open in new window

0
 

Author Comment

by:colonelblue
ID: 24361177
Hey and thank you. How do I add that to a button if I may ask?
0
 

Assisted Solution

by:ojohnson
ojohnson earned 750 total points
ID: 24385845
function openEmail()
      {
      var email="user@domain.com"                        
        top.location.href="mailto:"+email;
                  
      }

<form name="myform">
  <input type="button" name="email" value="Send Email" onclick="openEmail();" />

</form>
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
This article describes how to import Lotus Notes Contacts into Outlook 2016, 2013, 2010 and 2007 etc. with a few manual steps. You can easily export and migrate Lotus Notes contacts into Microsoft Outlook without having to use any third party tools.
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question