Jump to content

Recommended Posts

Posted

Hi,

I am writing Autoit script to send a mail, wait till its received, read it and then delete it. The objecttive here is to know how to confirm that I have received this email and read it and delete it. Am from a security company so I'm automating the outlook scanning for all the emails. The task is...

1) Send a mail

2) Wait till I receive that mail.

3) Read it

4) Delete it.

Note : I'm running the automation from the machine where am sending and receiveing the mail. (I'm sending the mails to self)

I have written for 'sending a mail' and this works fine, please find below the code. But am not able to write the code for the above steps 2) , 3) and 4).

Can somebody help please?

---------------------------- CODE FOR SENDING A MAIL ----------------------------

$File_path = "Path of the attachment"

Func SendAndReadMail($File_path)

$Outlook = ObjCreate('Outlook.Application')

$mail = $Outlook.CreateItem(0)

$mail.Recipients.Add("agovada@ex2k.com")

$mail.Body = $File_path

$mail.Subject = $File_path

$mail.Attachments.Add($File_path)

$mail.Send

EndFunc

--------------------------------------------------------

Neil

Posted

Please have a look at my OutlookEX UDF (please see my signature).

You could use function _OL_ItemFind to check for unread mails, then use Outlook method "Display" (there is no function available yet) and delete the mail using function _OL_ItemDelete.

Another approach can be found in the example scripts thread. The example there waits fo a new mail to arrive and then processes this mail.

If you need any assistance just psot your question.

My UDFs and Tutorials:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

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