Sign in to follow this  
Followers 0
gfcaim

email, again...

4 posts in this topic

I've searched the forum but all i've found seems to be regarding smtp such as gmail.

I simply wnat to send myself an email when my AutoIt script fails. This is on a company network where Outlook is the default client and is installed on the machine where the script is running, so the email will be internal. Is there a simple way to do this?

Apologies in advance if this is me being thick!


[font="Comic Sans MS"]"I'm not usually a praying man, but if you are up there, please save me Superman!" (Homer J. Simpson)[/font]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Local $olMailItem = 0
    Local $olFormatRichText = 3
    Local $olImportanceLow = 0
    Local $olImportanceNormal = 1
    Local $olImportanceHigh = 2
    Local $olByValue = 1
    Local $olFormatHTML = 2
    Local $olFormatPlain = 1
    $oOApp = ObjCreate("Outlook.Application")
    $oOMail = $oOApp.CreateItem ($olMailItem)
    $oOMail.Save
    With $oOMail
        .To = ("test@domain.com")
        .Subject = "subject of mail"
        .BodyFormat = $olFormatHTML
        .Importance = $olImportanceNormal
        .HTMLBody = "Hi There"
        .Send
    EndWith
    $oOApp=0

Edited by Juvigy

Share this post


Link to post
Share on other sites

Thanks very much for the replies, much appreciated.

The code form Juvigy sorts me out and the link from Jos I will spend some time in to learn for the future.

Thanks again.


[font="Comic Sans MS"]"I'm not usually a praying man, but if you are up there, please save me Superman!" (Homer J. Simpson)[/font]

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  
Followers 0