MsOutlook

In most cases, you can use Emacs Gnus or any mail client to get email from Microsoft Exchange server.

All you need to do is to install davmail (http://davmail.sourceforge.net/) which is a mail agent turn to outlook web url into pop3 or imap server.

It’s really easy to setup. The only minor issue is that Gnus MIGHT be better to use POP3 server of davmail. There was a minor issue, see http://blog.binchen.org/posts/how-to-get-email-from-exchange-server-without-outlook.html

But in latest cases, I use Gnus+Imap+davmail without any problem.

In rare cases, your company’s exchange server might modify the default EWS url . Then you need a software called EWSEdtor (https://ewseditor.codeplex.com/) to find the url. Then manually set up davmail with that url.

Now enjoy the world of Freedom.

BTW, you can use a mail classifying software Popfile (http://getpopfile.org/) to classify your emails.

 -- Chen Bin

Yes, you can use Emacs as the editor for Microsoft Outlook email. Basically you grab the text of an Outlook email/reply/forwarded message/etc., use Emacs to edit the reply or create a new message, and return the result to the Outlook editing window.

You might be interested in doing the reverse : use Outlook as the “mail server” for Emacs : MessageOutlook

You need some glue to move the message between Emacs and Outlook.

– can I do the same with Mozilla Mail ? http://globs.org/articles.php?lng=en&pg=2

Windows script glue

If your machine has the windows script host installed which should be true for almost all versions currently in use (see http://msdn.microsoft.com/library/default.asp?url=/nhp/default.asp?contentid=28001169) then you can use the following script instead of python or tcl. It is merely a port from tcl to Windows script.

Drop a copy of outlookedit.el from http://wiki.tcl.tk/9198 or https://github.com/dholm/outlookedit into your load-path, add a (require ‘outlookedit) to your init file.

Save the following code with extension .wsf somewhere on your path and adjust the variables mno-get-outlook-body and mno-put-outlook-body – MartinStemplinger

<?xml version="1.0" encoding="iso-8859-1"?>
<package>
  <job id="getMessage">
      <runtime>
          <description>
            This script gets a Message from an open Outlook window
      </description>
    </runtime>
    <script language="JScript">
      try {
        var app = new ActiveXObject("Outlook.Application");
        var inspector = app.ActiveInspector;
        
        WScript.StdOut.Write(inspector.CurrentItem.Body);       
      } catch (e) {
        WScript.Echo("Error: " + e)
      }
    </script>
  </job>
  <job id="putMessage">
    <runtime>
      <description>
        This script puts the content of StdIn back into an open Outlook
        window.
      </description>
    </runtime>
    <script language="JScript">
      try {
        var stdin = WScript.StdIn;                                 
        var app = new ActiveXObject("Outlook.Application");
        var inspector = app.ActiveInspector;
        var body = stdin.ReadAll();

       inspector.CurrentItem.Body= body;       
       inspector.display();
       inspector.Activate();
      } catch (e) {
       WScript.Echo("Error: " + e)
      }
    </script>
  </job>
</package>

In outlookedit.el (assuming you put the wsf script in ~/bin) --TimAnderson

 (defvar mno-get-outlook-body
   "cscript //B //Job:getMessage ~/bin/outlook_emacs.wsf")
 (defvar mno-put-outlook-body
   "cscript //B //Job:putMessage ~/bin/outlook_emacs.wsf")

Now, in order to edit the currently opened mail in emacs, say ‘mno-edit-outlook-message’ (bound to C-c o e). This opens an *Outlook Message* buffer with your mail. When you are done, say ‘mno-save-outlook-message’ (bound to C-c o s). Attention, the text is sent back to the “current” mail —if you switch back and forth between messages, you risk overwriting the bad message.

The message has to be opened for Reply for the above to work (M-r in Outlook ;-)). I added the snippet after the line beginning var inspector… to remind myself:

  // As above
  var inspector = app.ActiveInspector;

  // Reminder
  if (inspector == null) {
    WScript.StdOut.Write("You haven't opened the message up for Reply...");
    WScript.Quit(1);
  }

Toolbar button

You can also add a macro to Outlook and place that macro on a customized button in the toolbar:

Sub mnoEditInEmacs()
  Shell ("<PATH_TO_EMACS>\bin\gnudoit.exe (mno-edit-outlook-message)")
End Sub

If you have a recent emacs and EmacsClient is setup, you may prefer to call emacsclientw.exe --eval (mno-edit-outlook-message).

When you are replying to a mail, just press this button.

How to create a macro : in Outlook 2010, do a right-click on the Ribbon and select Customize Ribbon, then enable the Developer tab. In the Developer tab, there is a Macro menu that allow you to create a macro. To add the button, in the same Customize Ribbon, in the right column do Create a New Group. In the left column, select Choose Commands from: Macros, and you can add the button to the group you just added.

Forcing plain text mode

Attention, people have reported that some versions of Outlook don’t react too well to scripts changing the format under their nose. It works for me with Outlook 2010. YMMV. Caveat emptor.

In the getMessage part of the WSF script, add the following (mostly stolen from Ernie Longmire):

...
    var inspector = app.ActiveInspector;
    var mailItem = inspector.CurrentItem;

    /* HTML messages store the full text of the body with HTML
     * markup in a separate string, MailItem.HTMLBody.  In these
     * messages MailItem.Body contains a version of the message
     * with HTML markup removed.

     * When editing an HTML message, .Body is not synchronized with
     * .HTMLBody until .Body is accessed directly in some way.
     * In these cases, changing .BodyFormat to olFormatPlain puts
     * the empty .Body string in the editing buffer, discarding the
     * actual message content.  That's why we explicitly reference
     * .Body below. */
    var junk = mailItem.Body;
    mailItem.BodyFormat = 1;

    WScript.StdOut.Write(mailItem.Body);

Python or Tcl glue

The original implementation of the idea was done in Python. Apparently, versions of Windows old enough will not have the necessary scripting infrastructure, and a glue in Tcl or Python is necessary.

I just set this up under XP w/ Office XP and it worked beautifully.—EphremChristopherWalborn?

Pymacs

I put together a small package based on the Python code mentioned above, but taking advantage of PyMacs for better integration. It provides two commands:

The code can be downloaded from my Emacs page at http://home.nc.rr.com/nascifandelaine/emacs.html – NascifAbousalh?

(snatched code from http://wiki.tcl.tk/9198)

Another python solution is at http://barnson.org/node/295 (but what’s the point of going through some intermediate Tk application?)


CategoryWThirtyTwo WThirtyTwoSendMAPI