Jump to content

Discovering new mail event in Outlook


Recommended Posts

How can I make my AutoIt script wake up when a new mail arrives in my Outlook Desktop client?

I have disabled the auto notification popup that comes up on every incoming mail as I am plagued by spam.

I would like to send my HTC a page when emails from certain senders arrive in my mailbox.

How can this be done reliably?

Link to comment
Share on other sites

How can I make my AutoIt script wake up when a new mail arrives in my Outlook Desktop client?

I have disabled the auto notification popup that comes up on every incoming mail as I am plagued by spam.

I would like to send my HTC a page when emails from certain senders arrive in my mailbox.

How can this be done reliably?

Hi,

i like AutoIT a lot, but i think this could be easier done by an outlook ruleset.

;-))

Stefan

Link to comment
Share on other sites

Stefan,

Right now I am doing this with ruleset, however, I need some more advanced behaviour that would require very complex rulesets.

Thus, I would prefer to code the complex behaviour in, say AutoIt, and trigger the script from a simple rulset.

HTC/etc can be paged by sending an SMS/email to a specific address, but that is not the main goal. The main goal is classification of the mail and acting on some information embedded in the mailbody.

Link to comment
Share on other sites

Hi,

you have to code with com object. Here's the msdn reference:

http://msdn.microsoft.com/en-gb/library/ms268731(VS.80).aspx

Use search. There are mass of outlook examples so you can start coding.

For further assisstence explain your problem and post what you have coded so far.

;-))

Stefan

Link to comment
Share on other sites

Check out this example script:

Local $olFormatHTML = 2
Local $olFormatPlain = 1
Local $olFormatRichText = 3
Local $olFormatUnspecified = 0
Local $olMailItem = 0
;Local $olFormatPlain = 3
;Local $olFormatPlain=1
;Local $olImportanceLow = 0
;Local $olImportanceNormal= 1
;Local $olImportanceHigh = 2;

$oOApp = ObjCreate("Outlook.Application")
$oOMail = $oOApp.CreateItem($olMailItem)

With $oOMail
.To = ("bla@bla.com")
.Subject = "Subject " ; subject from the email - can be anything you want it to be
.BodyFormat = 1
.Body = "ALLBUDD" & @CRLF & "";
.attachments.add ("c:\1.txt")
.Display
.Send
EndWith
Link to comment
Share on other sites

Juvigy, I have already tried out that script, in fact here is a post I made that will show I have written code experimenting with the Outlook UDF: http://www.autoitscript.com/forum/index.php?showtopic=89321&view=findpost&p=746737

I want to know how I can catch new mail events from AutoIt.

Has anyone does this before?

Link to comment
Share on other sites

If you insist :

http://msdn.microsoft.com/en-us/library/aa155701%28office.10%29.aspx

You should use the NewMail event...

@Edit

Here you go :

$oOApp = ObjCreate("Outlook.Application")
$test=ObjEvent($oOApp,"oOApp_")

sleep(1111111)
$oOApp=0
$test=0

Func oOApp_NewMail()
MsgBox(0,"test","test")
EndFunc
Edited by Juvigy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...