Well, if you want a really backwards way to do it ( which is how I do it! ), i do it like the following:
1. Set up a complex rule in Outlook so that when a message arrives, the following sequence occurs:
a) Outlook can start up a program for you in the rule, i use it to start my perl program, which waits for:
b) Run the following VB script to save the email to a local file, which your perl script is polling
Sub WriteEmailToFile(MyMail As MailItem)
Dim myMailEntryID As String
Dim myMailBody As String
Dim outlookNameSpace As Outlook.NameSpace
Dim outlookMail As Outlook.MailItem
myMailEntryID = MyMail.EntryID
Set outlookNameSpace = Application.GetNamespace("MAPI")
Set outlookMail = outlookNameSpace.GetItemFromID(myMailEntryID)
Set fileSystemObject = CreateObject("Scripting.FileSystemObject")
/ you can create a dynamic text file name is you want...
Set textFile = fileSystemObject.CreateTextFile("c:\temp\OutlookEma
+il.txt", True)
textFile.WriteLine (outlookMail.SenderEmailAddress)
textFile.WriteLine (outlookMail.SentOn)
textFile.WriteLine (outlookMail.Subject)
outlookMailBody = outlookMail.Body
'strip non-printing characters
For x = 127 To 255
While InStr(outlookMailBody, Chr(x)) > 0
outlookMailBody = Replace(outlookMailBody, Chr(x), "")
Wend
Next x
textFile.WriteLine (outlookMailBody)
textFile.Close
End Sub
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|