Sign in to follow this  
Followers 0
HighlanderSword

Help Sending an HTML Outlook Message using Outlook UDf

4 posts in this topic

Hello,

I'm trying to use the outlook UDF to send an html message , I used Frontpage to create the HTML and then

added it into the Script, howwever when the email is sent it does not arrive as HTML

Below is exactly how the body of the email is whne it is received:

<html><head><meta http-equiv='Content-Language' content='en-us'><meta http-equiv='Content-Type' content='text/html; charset=windows-1252'><title>New Page 1</title></head><body><p><a href='file:///c:/versions.xlsx'>c:\versions.xlsx</a></p><p>&nbsp;</p></body></html>

Below is the code snippet, can someone please advise what I'm doing wrong ?

#Include "C:\Outlook.au3"

Local $oOutlook, $iresult

$oOutlook = _OutlookOpen()

$body ="<html>"

$body = $body & "<head>"

$body = $body & "<meta http-equiv='Content-Language' content='en-us'>"

$body = $body & "<meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>"

$body = $body & "<title>New Page 1</title>"

$body = $body & "</head>"

$body = $body & "<body>"

$body = $body & "<p><a href='file:///c:/versions.xlsx'>c:\versions.xlsx</a></p>"

$body = $body & "<p>&nbsp;</p>"

$body = $body & "</body>"

$body = $body & "</html>"

$iResult= _OutlookSendMail($oOutlook, "paul.schrader@domain.com", "", "", "test", $body,"",$olFormatHTML)

msgbox(0,"Outlook SendMail","Returncode: " & $iResult)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

There seems to be a bug in the Outlook UDF. Could you change line 425 in function _OutlookSendMail from

$oMessage.Body = $sBody

to

If $iBodyFormat = $olFormatHTML Then
    $oMessage.HTMLBody = $sBody
Else
    $oMessage.Body = $sBody
EndIf
and give it a try? Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hello,

That fixed the issue !!!

Thanks ...

Are you the owner of the Outlook UDF ?

Where are the updates posted for it ?

Share this post


Link to post
Share on other sites

Hello,

That fixed the issue !!!

Thanks ...

Are you the owner of the Outlook UDF ?

Where are the updates posted for it ?

Glad it works now!

I'm not the owner of the Outlook UDF. It's WoolTown. He has the intention to enhance the UDF and at the moment he's collecting ideas on the UDF's "

So if anything is missing post there and it might be included.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0