water Posted December 15, 2020 Author Share Posted December 15, 2020 Do you use any Outlook Add-Ons that coud cause the delay? 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...
cetipabo Posted March 1, 2021 Share Posted March 1, 2021 (edited) Hello, i have a strange problem when sending the email, the recipient is also added in the CC field... this is the piece of code i'm using, taken from the examples in the UDF zip. Global $oItem = _OL_ItemRecipientAdd($oOutlook, $aOL_Item[1][0], Default, $olOptional, $email) _OL_ItemRecipientAdd($oOutlook, $oItem, Default, $olTo, $email) So the result is the recipient added in both the To and CC fields... Any idea ? EDIT: OK, sorry, i found my mistake, i only need 1 line of code, my first line was adding the email in the CC field. This line is enough : Global $oItem = _OL_ItemRecipientAdd($oOutlook, $aOL_Item[1][0], Default, $olTo, $email) Edited March 1, 2021 by cetipabo Link to comment Share on other sites More sharing options...
cetipabo Posted March 1, 2021 Share Posted March 1, 2021 (edited) Well now I have a new problem... My script works well at home on a windows 10 PC + Outlook 2019, as well on my PC at the office with win10 + outlook 2019 too. But from the PC the script was developped for, under Win7 and office 2010, it doesn't. The attached files (4 simple .PDF files) are disabled by outlook, they are considered potentialy dangerous...i don't have this problem when the script is executed from my PC... When runing the script, Outlook detects that and external programm tries to send an email so it asks me if yes or now i allow this, i say YES, but there might be something flagging the emails as suspicious... Edited March 1, 2021 by cetipabo Link to comment Share on other sites More sharing options...
water Posted March 1, 2021 Author Share Posted March 1, 2021 Which antivirus software do you run on your Win 7 PC? 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...
cetipabo Posted March 1, 2021 Share Posted March 1, 2021 (edited) i was runing the script without any antivirus, but I remember i had a similar problem in the past because there was no antivirus installed... so i tried with Symantec endpoint protection and restarted the PC, the behavior is the same... Now i see that i have that alert message about "something is trying to send an email..." when i run the script from the .au3 file, BUT i have no alert message when runing the compiled sscript (.exe) but in this case the attached files are disabled... Edited March 1, 2021 by cetipabo Link to comment Share on other sites More sharing options...
cetipabo Posted March 1, 2021 Share Posted March 1, 2021 (edited) i found this, not sure if it gonna help me, according to what they say in the quote : https://www.howto-outlook.com/products/outlooktools.htm Edit : it didn't fix the problem. Also tried the registry Fix here : https://appuals.com/fix-outlook-blocked-access-to-the-following-potentially-unsafe-attachments/ Problem not Fixed...That's Crazy !! Edited March 1, 2021 by cetipabo Link to comment Share on other sites More sharing options...
water Posted March 1, 2021 Author Share Posted March 1, 2021 With _OL_Open you can start a second process to look for such messages and click them away. An example is provided but might be modified due to Outlook version and language. 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...
cetipabo Posted March 1, 2021 Share Posted March 1, 2021 haa are you speaking about this : $bWarningClick ? Link to comment Share on other sites More sharing options...
water Posted March 1, 2021 Author Share Posted March 1, 2021 👍🏻 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...
Hermes Posted March 2, 2021 Share Posted March 2, 2021 Thank you! Link to comment Share on other sites More sharing options...
water Posted March 2, 2021 Author Share Posted March 2, 2021 Please stop posting "Thank you!" just to push up your post count! Witcher 1 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...
Witcher Posted March 18, 2021 Share Posted March 18, 2021 Hi, Need help. My society prevents automated e-mail transfer. We are monitoring a pump system and would like to receive alerts when we are not at work on a external box. I tried the _OL_ItemForward example script. No error but obviously the forwarded mails are blocked. What solution can I apply? recreate the email and add the body and send it ? example appreciated . thanks Link to comment Share on other sites More sharing options...
Developers Jos Posted March 18, 2021 Developers Share Posted March 18, 2021 @Witcher Welcome.... I doubt the provided information is clear enough to be able to assist you. Show what you have now as a start and tell us what you mean by "blocked"....blocked where/by what? Jos Witcher 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Witcher Posted March 19, 2021 Share Posted March 19, 2021 Hi jos, I try to clarify. I ve used the example script below. It works fine : connect to the mail box, find the mails unread and send them to a external address. I see outlook display the message "sending mail...". But the mail doesn't arrive in the external mailbox. I don't know exactly what blocks ( a admin rule on the exchange server?). I ve tried with a rule in Outlook to forward automatically some mails. This gives the same result. When i forward the mail manualy to the external mailbox, it works. That why, i am interested in Outlookex_udf to simulate a manual sending.. Thanks for your answer... ; Include Functions #include <OutlookEX.au3> Global $oForward, $sRecipient = "John.Doe@company.com" ; Connect to Outlook Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "Connect to Outlook", "Error connecting to Outlook. @error = " & @error & ", @extended = " & @extended) ; Access correct mailbox Global $aFolder = _OL_FolderAccess($oOutlook, "\\Correct Mailbox\Inbox", $olFolderInbox) If @error <> 0 Then Exit MsgBox(16, "Folder access", "Error accessing the mailbox. @error = " & @error & ", @extended = " & @extended) ; Get unread items Global $aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, "[UnRead]=True", "", "", "EntryID,Subject,Body") If @error <> 0 Then Exit MsgBox(16, "Item find", "Error searching for unread mail items. @error = " & @error & ", @extended = " & @extended) MsgBox(0, "Number of unread items", $aItems[0][0]) If $aItems[0][0] = 0 Then Exit MsgBox(16, "Error", "No mail items in Correct Mailbox Inbox.") ; Forward all unread mails For $i = 1 To $aItems[0][0] $oForward = _OL_ItemForward($oOutlook, $aItems[$i][0], Default, "") ; Create a copy of the item to forward If @error <> 0 Then Exit MsgBox(16, "Item forward", "Error creating an item copy to forward. @error = " & @error & ", @extended = " & @extended) _OL_ItemRecipientAdd($oOutlook, $oForward, Default, $olTo, $sRecipient) ; Add recipient If @error <> 0 Then Exit MsgBox(16, "Recipient add", "Error adding a recipient to the mail item. @error = " & @error & ", @extended = " & @extended) _OL_ItemSend($oOutlook, $oForward) ; Send the item to the recipient If @error <> 0 Then Exit MsgBox(16, "Item send", "Error sending the mail item. @error = " & @error & ", @extended = " & @extended) Next ; Close connection to Outlook _OL_Close($oOutlook) Link to comment Share on other sites More sharing options...
water Posted March 19, 2021 Author Share Posted March 19, 2021 I think the OutlookEX UDF and the Outlook rule to forward mails use the same API. So what blocks the Outlook rule blocks the OutlookEX UDF as well. I think it would be best to talk to your IT-professionals. Maybe they use the Microsoft data classification system or other rules to block transferring mails to an EXTERNAL mailbox. Witcher 1 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...
Witcher Posted March 20, 2021 Share Posted March 20, 2021 Hi water, Unfortunately the IT administrator will not make an exception for my need even if he understands it. Mails automatically forwarded are blocked. Not the others. A sort of data loss protection? If I put the unread mails in a array and then with a loop, generate a few mails with subject and body, from the array, which I send. Is this possible to do with OutlookEX_UDF? Thanks for your answer... Link to comment Share on other sites More sharing options...
water Posted March 20, 2021 Author Share Posted March 20, 2021 If your IT-admin decides to block forwarded mails then this is a security measure of your company. To bypass such security decisions is a very BAD idea. I have been working in IT-security for years. Everyone who tried or did bypass our security measures was in BIG troubles. Why do you think it's necessary to forward company emails to an external (private) mailbox? 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...
Witcher Posted March 20, 2021 Share Posted March 20, 2021 it is to intervene as quickly as possible on an alert. otherwise I have to connect to the mailbox to check regularly if everything is fine. SMS is perhaps an other possibility... I don't know the other reasons of the blocking... Link to comment Share on other sites More sharing options...
water Posted March 20, 2021 Author Share Posted March 20, 2021 If it is your job to respond to alerts as quickly as possible then your company needs to provide tools so you can do your job. The company should send the alerts by using pager or SMS or phone call. You could then check your mail for details. 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...
Witcher Posted March 20, 2021 Share Posted March 20, 2021 I stop off topic. Thanks anyway Water. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now