Jump to content

OutlookEX UDF - Help & Support (III)


water
 Share

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

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

Link to comment
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 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

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

#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
Link to comment
Share on other sites

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

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
Link to comment
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 ?

 

 

Link to comment
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 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

 

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
Link to comment
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 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

  • 2 weeks later...

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

 

Link to comment
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.

Link to comment
Share on other sites

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

 

Link to comment
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 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

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...