water Posted March 5, 2017 Author Posted March 5, 2017 I do not think it is a problem with the send function as it just sends the mail. But you could simply replace the function with $oItem.Send() I fear it is a problem with HTML and the way our mail gets interpreted by Gmail. 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
tourism123 Posted March 5, 2017 Posted March 5, 2017 Use $oItem.Display() It will create draft email in google mail web, it show right with inline picture (but Attachment doesn't hidden). Send draft email and i get a ugly email. i see source this email: --94eb2c0cadb021774d0549fb2309 Content-Type: text/plain; charset=UTF-8 Bodytext in *bold*Embedded image. --94eb2c0cadb021774d0549fb2309 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Bodytext in <b>bold</b><img src=3D"https://mail.google.com= /mail/u/0/?ui=3D2&ik=3D43894edd3c&view=3Dfimg&th=3D15a9e7f2b20c= eb6c&attid=3D0.1&disp=3Demb&attbid=3DANGjdJ_d3FibxOZINjYmBp_0zu= 2VsPK7fag0kc7_NJ7PwR1xqtS5-DCzfsC9n0LmPMMWBMINRV-HezEd2QA4yDvUVH105VRUDYrvo= JfABQ1OqUD12GZmeJyyBe-oywQ&sz=3Ds0-l75-ft&ats=3D1488717831677&r= m=3D15a9e7f2b20ceb6c&zw&atsh=3D1">Embedded image.</div> --94eb2c0cadb021774d0549fb2309-- --94eb2c0cadb021777e0549fb230b Content-Type: image/jpeg; name="The_Outlook.jpg" Content-Disposition: attachment; filename="The_Outlook.jpg" Content-Transfer-Encoding: base64 Content-ID: <myident1> X-Attachment-Id: 120543b37a7fa09e_0.1 --94eb2c0cadb021777e0549fb230b-- I don't understand what happened
water Posted March 5, 2017 Author Posted March 5, 2017 I have absolutely no idea what happens here Maybe someone else on this forum or on the web knows how to solve this problem. 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
water Posted March 6, 2017 Author Posted March 6, 2017 One last idea would be to manually create a mail that works and store it as a template. Pass the template to itemcreate and replace the attachment with the needed picture (using the same CID). tourism123 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
tourism123 Posted March 6, 2017 Posted March 6, 2017 (edited) #include <OutlookEx.au3> $oOutlook = _OL_Open() $oMail = _OL_ItemCreate($oOutlook, $olMailItem, "", "", "Subject=TestMail", "BodyFormat=" & $olFormatHTML, _ 'HTMLBody=This is a picture. <b>bold</b>. This is more text.') _OL_ItemRecipientAdd($oOutlook, $oMail, Default, 1, 'abc@gmail.com') _OL_ItemSend($oOutlook, $oMail, Default) _OL_Close($oOutlook) I use this simple code and get this mail (No FormatHTML, have a winmail.dat??) What happen?? Edited March 6, 2017 by tourism123
water Posted March 6, 2017 Author Posted March 6, 2017 (edited) Maybe this sheds some light onto the subject: https://support.mozilla.org/t5/Basics/What-is-the-winmail-dat-attachment/ta-p/15886 Edit: Or even better: https://www.lifewire.com/prevent-sending-winmail-dat-attachments-1173717 Edited March 6, 2017 by water tourism123 and Skysnake 2 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
tourism123 Posted March 6, 2017 Posted March 6, 2017 (edited) I tried but it didn't work. I find 2 link. I think it can help but I do not understand much. http://stackoverflow.com/questions/32900976/prevent-winmail-dat-in-outlook-for-gmail-accountshttps://blogs.msdn.microsoft.com/stephen_griffin/2008/08/04/forcing-plain-text-with-mapi/Edit: All my problems have been resolved by DisableTNEF. I fixed it by following the link, it show ok. @water, thank you https://support.microsoft.com/en-us/help/958012/winmail.dat-sent-as-an-email-attachment-in-outlook-2007-and-2010 Edited March 7, 2017 by tourism123 Skysnake 1
HighlanderSword Posted March 8, 2017 Posted March 8, 2017 Hello Water, I have a Need to be able to determine if Outlook is currently sending/receiving email. I have a process that requires outlook to be closed and I don't want to kill outlook while it its sending/receiving email, So i need a way to validate if that is occurring so I can wait for it to finish before gracefully closing outlook. IS there anything in your UDF that would assist with this that I missed ? If not could you point me in the right direction ?
water Posted March 8, 2017 Author Posted March 8, 2017 You could call function _OL_ItemSendReceive. Calling the SendAndReceive method is synchronous. So when the function returns all items have been sent and you could safely shutdown Outlook. 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
HighlanderSword Posted March 9, 2017 Posted March 9, 2017 (edited) Hello Water. When I execute the code line below it returns immediately even though outlook is still Sending/receiving email, I can see in outlook that its still processing email $results= _OL_ItemSendReceive($oOutlook,false) $results =1 and extended =0 Edited March 9, 2017 by HighlanderSword
water Posted March 9, 2017 Author Posted March 9, 2017 Unfortunately I didn't find another way to check the status of Outlook. Could you please check the content of the Sent folder while Outlook is sending mails? So you could make sure that at least there remain no mails to be sent when the item count is 0. Another question. Why does your process require Outlook to be closed? 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
4bst1n3nz Posted March 23, 2017 Posted March 23, 2017 How can i use a delegated mailbox to send mails? Global $aAccounts = _OL_AccountGet($oOL) _ArrayDisplay($aAccounts) shows only my first mailbox, not my 3 delegated mailboxes.
water Posted March 23, 2017 Author Posted March 23, 2017 How about _OL_StoreGet? 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
4bst1n3nz Posted March 23, 2017 Posted March 23, 2017 But it still uses my first profile to send mails... $oO = _OL_Open() $store = _OL_StoreGet($oO) $oMail = _OL_ItemCreate($oO, $olMailItem, "Test\Drafts", "", "Subject=Test") $oMail = _OL_ItemRecipientAdd($oO, $oMail, $store[5][7], $olBCC, "test@test.com") $oMail = _OL_ItemAttachmentAdd($oO, $oMail, $store[5][7], @ScriptDir & "\gui.kxf") $oMail = _OL_ItemModify($oO, $oMail, $store[5][7], "Body=test") $oResult = _OL_ItemSend($oO, $oMail, $store[5][7]) _OL_Close($oO) $store[5][7] is in this case a very long number.
water Posted March 23, 2017 Author Posted March 23, 2017 The wiki should shed some light on this issue. 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
4bst1n3nz Posted March 23, 2017 Posted March 23, 2017 There's described how to send from an another account. But not from another Group-Mailbox. I just have 1 Account with 3 additional delegated Mailboxes.
4bst1n3nz Posted March 23, 2017 Posted March 23, 2017 When i send the mail via "SentOnBehalfOfName" will the mail be moved to the "Sent"-Folder in the main-account instead of the senders account.
water Posted March 23, 2017 Author Posted March 23, 2017 Don't know from the top of my head. Did you try? 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
4bst1n3nz Posted March 23, 2017 Posted March 23, 2017 $oO = _OL_Open() $store = _OL_StoreGet($oO) $oMail = _OL_ItemCreate($oO, $olMailItem, "Test\Drafts", "", "Subject=Test") $oMail = _OL_ItemRecipientAdd($oO, $oMail, $store[5][0], $olBCC, "test@test.com") $oMail = _OL_ItemAttachmentAdd($oO, $oMail, $store[5][0], @ScriptDir & "\gui.kxf") $oMail = _OL_ItemModify($oO, $oMail, $store[5][0], "Body=Test") $oMail.SentOnBehalfOfName = $store[5][0] $oResult = _OL_ItemSend($oO, $oMail, $store[5][0]) _OL_Close($oO) This will send a mail with the right store as sender. But this mail will still be copied to my "Sent"-folder instead of the senders "Sent"-folder.
Recommended Posts