Jump to content
Sign in to follow this  
water

OutlookEX UDF - Help & Support (III)

Recommended Posts

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 2020-07-21 - Version 1.5.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - 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
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

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&amp;ik=3D43894edd3c&amp;view=3Dfimg&amp;th=3D15a9e7f2b20c=
eb6c&amp;attid=3D0.1&amp;disp=3Demb&amp;attbid=3DANGjdJ_d3FibxOZINjYmBp_0zu=
2VsPK7fag0kc7_NJ7PwR1xqtS5-DCzfsC9n0LmPMMWBMINRV-HezEd2QA4yDvUVH105VRUDYrvo=
JfABQ1OqUD12GZmeJyyBe-oywQ&amp;sz=3Ds0-l75-ft&amp;ats=3D1488717831677&amp;r=
m=3D15a9e7f2b20ceb6c&amp;zw&amp;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 :sweating:

Screenshot (8).png

Screenshot (9).png

Share this post


Link to post
Share on other sites

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 2020-07-21 - Version 1.5.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - 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
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

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). 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-07-21 - Version 1.5.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - 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
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites
#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?? :'(

abc.png

Edited by tourism123

Share this post


Link to post
Share on other sites

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-07-21 - Version 1.5.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - 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
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

I tried but it didn't work.
I find 2 link. I think it can help but I do not understand much. :sweating:
http://stackoverflow.com/questions/32900976/prevent-winmail-dat-in-outlook-for-gmail-accounts
https://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 by tourism123

Share this post


Link to post
Share on other sites

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 ?

 

 

Share this post


Link to post
Share on other sites

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 2020-07-21 - Version 1.5.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - 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
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

 

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 by HighlanderSword

Share this post


Link to post
Share on other sites

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 2020-07-21 - Version 1.5.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - 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
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

How about _OL_StoreGet?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-07-21 - Version 1.5.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - 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
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

The wiki should shed some light on this issue.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-07-21 - Version 1.5.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - 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
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Don't know from the top of my head. Did you try?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-07-21 - Version 1.5.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - 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
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites
$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.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By pat4005
      A tiny UDF that can shoot magic packets at your computers to wake them the heck up. All credits to Olish.
      The only parameter it needs to be specified – is your machine's MAC-address (ip address (the second parameter), at which you will be sending magic packet is generating automatically from @IPAddress1 macro)
      Example:
      _WoL_WakeDevice('001CC0CAED7A') ; the second parameter (if necessery) must be a broadcast address of your local network segment (i.e. 192.168.0.255 for a network 192.168.0.0)  
      _WakeOnLan.au3
    • By water
      Extensive library to control and manipulate Microsoft Outlook. This UDF holds the functions to automate items (folders, mails, contacts ...) in the background. Can be seen like an API.
      There are other UDFs available to automate Outlook:
      OutlookEX_GUI: This UDF holds the functions to automate the Outlook GUI. OutlookTools: Allows to import/export contacts and events to VCF/ICS files and much more.  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: 2020-02-09)
      None
    • By MrCreatoR
      This UDF allows to create formatted label using pseudo element RichLabel (RichEdit actually). Formating is set by using special modificator similar to <font> tag in Html.
      Notes: This UDF is a transformation-continuation of related UDF


      Example:
      Download:
      GUIRichLabel_1.2.zip
      Small syntax related fix: GUIRichLabel_1.1.zip
      GUIRichLabel_1.1.zip
       
      History version:
    • By PoojaKrishna
      Hi,
      I am trying to print items from Outlook in a Citrix machine. I am printing the items into PDF files using ‘Microsoft Print to PDF option’. I am using OutlookEX.au3 for printing items.
      Everything is working fine except handling the ‘Save Print Output As’ dialog appearing while trying to print the file to PDF.
      I have set the default printer to ‘Microsoft Print to PDF’ from the control panel ( Control Panel\All Control Panel Items\Devices and Printers) and using the following method to print the item.
      _OL_ItemPrint($oOutlook, $OL_Item) ;print item I am not able to handle the ‘Save Print Output As’ dialog initiated by the print statement in the Citrix machine. The WinActive method always returns false. I have tried with ControlSetText, ControlClick and Send methods also.
      Can anyone please help?
      Func _SavePDF($sFilePath) WinActivate ( "Save Print Output As", "") WinWaitActive ( "Save Print Output As", "",5 ) If WinActive("Save Print Output As") Then sleep(500) Send($sFilePath) sleep(500) Send("{ENTER}") sleep(500) EndIf EndFunc;=>_SavePDF  
    • By Stormgrade
      Hello,
      I'm searching the UDF GDIpProgress.au3 from ProgAndy
      None of the links in topic
       works
      Can't someone upload it please ?
×
×
  • Create New...