Alexandre Posted April 11, 2013 Share Posted April 11, 2013 %username% is the system envoirent for the corrent user logon. Link to comment Share on other sites More sharing options...
water Posted April 11, 2013 Author Share Posted April 11, 2013 (edited) Your example script uses CDO. CDO is deprecated by MS so you need to install CDO on WIndows 7 and later. But you still don't get what the OP wants. He wants the # of unread mails plus subject. BTW: I suggest to remove userid/password from your example code Edited April 11, 2013 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Alexandre Posted April 11, 2013 Share Posted April 11, 2013 (edited) smtp.gmail.com %usrname% someone@someone.com someone2@someone2.com Line 1 smtp hosntame Line 2 %username% who send the mail Line 3 email adress of the sender Line 4 mailto: ex someone@someone.com You can download this api from microsoft web site SendMailExchangeCdo.exe SendMailExchangeMapiCdo.EXE Edited April 11, 2013 by Alexandre Link to comment Share on other sites More sharing options...
water Posted April 11, 2013 Author Share Posted April 11, 2013 BTW: When you post code please wrap it in [autoit][/autoit] tags. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Alexandre Posted April 11, 2013 Share Posted April 11, 2013 You need to use SendMailFileConstants.au3 SendMailFileInclude.au3 Link to comment Share on other sites More sharing options...
Alexandre Posted April 11, 2013 Share Posted April 11, 2013 Your example script uses CDO. CDO is deprecated by MS so you need to install CDO on WIndows 7 and later.But you still don't get what the OP wants. He wants the name/mail address of the currently logged on user. Your username is hard coded.BTW:my mistake soryI suggest to remove userid/password from your example code Link to comment Share on other sites More sharing options...
water Posted April 11, 2013 Author Share Posted April 11, 2013 Can you please open a new thread for discussion of your script? This is the Outlook UDF thread. The user posted here because he wanted a solution based on Outlook. Thanks! My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Alexandre Posted April 11, 2013 Share Posted April 11, 2013 (edited) I has trying to help user with one script that can do what he wont's connecting directly to smtp server. Edited April 11, 2013 by Alexandre Link to comment Share on other sites More sharing options...
water Posted April 11, 2013 Author Share Posted April 11, 2013 Can you please post the post number you refer to? I still don't get how the user I refer to (post # 152) should solve his problem with your solution. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
lolipop Posted April 12, 2013 Share Posted April 12, 2013 (edited) You can do this either by searching for unread mails every x minutes/seconds or by waiting for a new mail to arrive and then handling this event.What do you prefer?Well, I'm think waiting for a new mail to arrive and then handling this event would be better in terms of resources handling. Correct me if I'm wrong.Which do you think is the better approach? Also, does anyone have any experience with integrating AutoIT with Live Tiles?The reason I'm looking for this UDF solution is because the default Mail Live Tiles from Windows 8 doesn't work well in a enterprise environment with exchange protocol. So I'm thinking if we can explore ways to make it like a live tiles and using the AutoIT way. Edited April 12, 2013 by lolipop Link to comment Share on other sites More sharing options...
water Posted April 12, 2013 Author Share Posted April 12, 2013 Event handling is the better approach in terms of ressource usage.Examples can be found Live Titles: No, Windows 8: No My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
HighlanderSword Posted April 12, 2013 Share Posted April 12, 2013 Listed below is the Code I came up with to provide a list of all folder availavale in all open PST files. Does any anyone have a faster way to accomplish this task ? I have several situation where the user has 10 or more pst files open so this process can take any where from 40 seconds or more to complete. Func Folder_List() Global $aPST = _OL_PSTGet($oOutlook) $aResult=_OL_FolderTree($oOutlook,"*") ;~ _ArrayDisplay($apst) ;~ $aResult=_OL_FolderTree($oOutlook,$apst[1][0]) ;~ _ArrayDisplay($aResult) _ArrayDelete($aResult,0) if UBound($apst) -1 >1 then for $loop = 2 to UBound($apst) -1 $Tmparray=_OL_FolderTree($oOutlook,$apst[$loop][0]) _ArrayDelete($Tmparray,0) _ArrayConcatenate($aResult, $Tmparray) Next EndIf _ArraySort($aResult,0) EndFunc Link to comment Share on other sites More sharing options...
water Posted April 12, 2013 Author Share Posted April 12, 2013 How many folders do we talk about? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted April 13, 2013 Author Share Posted April 13, 2013 I just tested and it takes 0.7 seconds to process 4 PST files with 286 folders. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
cookiemonster Posted April 20, 2013 Share Posted April 20, 2013 Hi all, ive just quickly bashed up the following script, which should take the data from the input and use it as the subject for the appointment it creates, but when i run it, it creates the appointment but with the subject as the number 3, anyone got any ideas? #AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y #include <OutlookEX.au3> #include <Date.au3> GUICreate("", 285, 103, 290, 224) Global $Inbut_Area = GUICtrlCreateInput("", 8, 32, 265, 21) GUICtrlCreateLabel("Question Text", 8, 8, 70, 17) Global $Ok_Button = GUICtrlCreateButton("OK", 120, 64, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Ok_Button runit() EndSwitch WEnd func runit () Local $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF", "Error creating a connection to Outlook. @error = " & @error & ", @extended = " & @extended) Local $sCurrentUser = $oOutlook.GetNameSpace("MAPI").CurrentUser.Name Local $sStart = StringLeft(_Nowcalc(),16) Local $sEnd = StringLeft(_DateAdd("h", 3, _NowCalc()), 16) _OL_Wrapper_CreateAppointment($oOutlook, $Inbut_Area, $sStart, $sEnd, "My office", False, "Testbody", _ 15, $olBusy, $olImportanceHigh, $olPrivate, $olRecursWeekly, $sStart, _DateAdd("w", 3, $sEnd), 1) If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OutlookCreateAppointment Wrapper Script", "Error creating appointment. @error = " & @error & ", @extended: " & @extended) MsgBox(64, "OutlookEX UDF: _OutlookCreateAppointment Wrapper Script", "Appointment successfully created '" & $sCurrentUser & "'!") _OL_Close($oOutlook) endfunc ;runit Link to comment Share on other sites More sharing options...
water Posted April 20, 2013 Author Share Posted April 20, 2013 $Inbut_Area contains the Id of the control. You need to use GuiCtrlRead($Inbut_Area) My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
HighlanderSword Posted April 21, 2013 Share Posted April 21, 2013 Hello, Is their a way to deternine if outlook is fetching email from pop3 ? I want to process email after the scheduled retrieval has been comnpleted. I can tell when new messages arrive, but havent been able to figuree out how to tell when it done receiving them. So for an example , If i set up a procedure to monitor the new mail it fires for every email recevied, Once it determine its getting email is their some object I can check in a loop to say wait for this object to stop processing, then i know the retrival of email has been completed. Thanks Paul Link to comment Share on other sites More sharing options...
HighlanderSword Posted April 21, 2013 Share Posted April 21, 2013 Hello, With regards to my code for getting all of the folders in a pst , I have 20 open PSt folders and over 5000 sub folders in each. This process tkaes about 2- 3 minutes to run. Thanks Paul Link to comment Share on other sites More sharing options...
water Posted April 21, 2013 Author Share Posted April 21, 2013 What's the problem with processing mails as soon as they arrive? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted April 21, 2013 Author Share Posted April 21, 2013 With regards to my code for getting all of the folders in a pst , I have 20 open PSt folders and over 5000 sub folders in each.This process tkaes about 2- 3 minutes to run.That's about 100000 folders. I would suggest to create a second script to extract the folders to a text file and then read this file in a second script. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts