Jump to content
Sign in to follow this  
Akshay07

Read emails headers or content

Recommended Posts

Akshay07

Hi all,

I am trying to achieve the following:

When an email is received with a specific subject field, I want to trigger an autoit script.

I am not sure how to do the first part (monitor emails and check for the email subject filed, or even better, email content).

I have no specific requisites about the email client, it could be outlook, thunderbird, or other. It would be okay as well to read the email header only from an online gmail account.

I know it is possible with a gmail account (there are severals widgets that can do that) but I was wondering if this can be done using autoit ? My programming knowledge is very poor, and I doubt I can go through the use of Google APIs for this.

Share this post


Link to post
Share on other sites
water

If you run Outlook you could have a look at my OutlookEX UDF. It allows to write scripts that handle the NewMail event and then process the mail accordingly.

Will post more info as soon as I'm back from vacation.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
PhoenixXL

U can get the summary of the Gmail Email and u can get the full title the sender date time Message Number etc using the Gmail Atom feed

Here it has been described more properly have a look


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites
Akshay07

Thanks for your answers, will check the links.

Share this post


Link to post
Share on other sites
PhoenixXL

Well I even had the same Idea

I have made an UDF for what you want

Herez the


My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

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  

  • Similar Content

    • water
      By water
      Extensive library to control and manipulate Microsoft Outlook.
      Theads: Development - General Help & Support - Example Scripts - Wiki
      BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort

      KNOWN BUGS (last changed: 2018-09-01)
      None
    • Gowrisankar
      By Gowrisankar
      Dear members of the forum,
      I need to open the attachments from mails without downloading them. Is it possible using OutlookEx UDF ?
    • Gowrisankar
      By Gowrisankar
      Dear members,
      I'm trying to get the attachments from mails using OutlookEx UDF and then save them in a particular location.
      The UDF considers even the signature images and other images in the mail body as attachments, and saves it in the folder I point. I want only the proper attachment documents to be saved.
      Requesting the guidance of the forum members.
       
       
      Thanks and regards,
      Gowrisankar R.
    • Gowrisankar
      By Gowrisankar
      Dear members,
      I'm trying to move unread mails from Inbox to a different folder using OutlookEx UDF.
      But its not working for me. I'm not sure what mistake I do.
      I get the error code 6 when the following is executed. From the UDF it is observed that  "No or an invalid item has been specified".
      Note : The UDF version is 1.3.3.1. AutoIt version (v3.3.14.2).
      #include <OutlookEX.au3> Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) Global $aOL_Item = _OL_ItemFind($oOutlook, "*\Inbox", $olMail, "[UnRead]=True", "", "", "Subject", "", 1) If $aOL_Item[0][0] = 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemMove Example Script", "Could not find a task item in folder 'Outlook-UDF-Test\SourceFolder\Tasks'. @error = " & @error) _ArrayDisplay($aOL_Item, "OutlookEX UDF: _OL_ItemFind Example Script - Unread mails") _OL_ItemMove($oOutlook, $aOL_Item[1][0], Default, "*\Outlook-UDF-Test\TargetFolder\Mail") If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemMove Example Script", "Error moving specified task. @error = " & @error) Any help is deeply appreciated. Thanks in advance.
      Thanks and regards,
      Gowrisankar R.
    • horrscht6
      By horrscht6
      Hello together,
      I am searching for hours in the web and this forum too but no articles helps really.
      Issue:
      In the background Thunderbird is running and receives mails and fax (as PDF mails). If a specific mail will be received and the rules detect this mail an external program will be executed. The external program is the AutoIt script. Execution will be okay but the result is not okay: If the button $btnShowMailProg is pressed: The Thunderbird should appear to show the important mail.
      ==> This is the problem.
      I have tried several times and different code examples but Thunderbird will not be shown in the front. Who can help me or show a code example which shows an already in background running program active again in the foreground?
      Thanks in advance for your help.
      Matthias
      Sorry, the GUI is for a german office usage and therefore the text messages are in german. But this doesn't matter for the asked issue.
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <AutoItConstants.au3> $Form1_1 = GUICreate("BENACHRICHTIGUNG: Wichiges FAX eingegangen", 422, 220, -1, -1,$WS_EX_TOPMOST) $Label1 = GUICtrlCreateLabel("Diese Benachrichtigung wird angezeigt, weil die Filter-Regeln", 24, 18, 390, 17) GUICtrlSetFont(-1, 10, 400 , 0, "Arial") $Label2 = GUICtrlCreateLabel("im Email-Programm den Eingang eines wichtigen FAX oder", 24, 38, 390, 17) GUICtrlSetFont(-1, 10, 400 , 0, "Arial") $Label3 = GUICtrlCreateLabel("einer wichtigen EMAIL festgestellt haben.", 24, 58, 390, 17) GUICtrlSetFont(-1, 10, 400 , 0, "Arial") $btnShowMailProg = GUICtrlCreateButton("Email-Programm in den Vordergrund bringen", 24, 92, 355, 33, 0) GUICtrlSetFont(-1, 10, 700 , 0, "Arial") $btnClose = GUICtrlCreateButton("Dieses Fenster schließen", 24, 135, 203, 41, 0) GUISetState(@SW_SHOW) $hWnd = WinGetHandle("[ACTIVE]") WinSetOnTop($hWnd, "", $WINDOWS_ONTOP) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btnClose Exit case $btnShowMailProg if ProcessExists("thunderbird.exe") Then $hWnd2 = ProcessExists("thunderbird.exe") WinSetOnTop($hWnd, "", $WINDOWS_NOONTOP ) GUISetState(@SW_HIDE) $return0 = WinActivate($hWnd2) $return1 = WinSetState($hWnd2, "", @SW_MAXIMIZE) $return2 = WinSetState($hWnd2, "", @SW_SHOW) MsgBox (0, "DEBUG-Info", "$hWnd2=" & $hWnd2 & @CRLF & "$return0=" & $return0 & @CRLF & "$return1=" & $return1 & @CRLF & "$return2=" & $return2 ) If Not WinActive($hWnd2) Then MsgBox (0, "DEBUG-Info", "Thunderbird manuell öffnen!" ) Run("thunderbird.exe") WinActivate($hWnd2) WinSetState($hWnd2, "", @SW_MAXIMIZE) WinSetState($hWnd2, "", @SW_SHOW) EndIf MsgBox (0,"INFO","Programm wird beendet.") Else MsgBox (0, "DEBUG-Info", "Thunderbird manuell öffnen!" ) EndIf Exit EndSwitch WEnd Exit  
×