Jump to content
Sign in to follow this  
JavaAutomater

Discovering new mail event in Outlook

Recommended Posts

JavaAutomater

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?

Share this post


Link to post
Share on other sites
99ojo

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

Share this post


Link to post
Share on other sites
Juvigy

How do you do that : "I would like to send my HTC a page"

Share this post


Link to post
Share on other sites
JavaAutomater

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.

Share this post


Link to post
Share on other sites
99ojo

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

Share this post


Link to post
Share on other sites
Juvigy

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

Share this post


Link to post
Share on other sites
JavaAutomater

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?

Share this post


Link to post
Share on other sites
Juvigy

You said that you plan to use rule for that , right?

Something like "when new mail arrives , execute my AutoIT app"

Share this post


Link to post
Share on other sites
Juvigy

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

Share this post


Link to post
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
Sign in to follow this  

×