I have an Excel VBA Macro that sends HTML email messages using the Outlook.Application object and referencing the Microsoft Office 16.0 Object Library, Microsoft Office 16.0 Outlook Library, and the Microsoft Excel 16.0 Object Library.
This VBA Macro has run for several years without modifications and without problems.
At the end of December, it worked fine. At the end of January, the emails look OK in the Draft folder but once sent, they appear to the recipient as text (uninterpreted MIME text). If I send them to myself, they also appear as text (uninterpreted MIME text).
I tried sending with an outlook.com, gmail.com, aol.co.uk and yahoo.com From: and all had the same result. That lead me to believe that it wasn’t the email service but maybe Outlook itself that had changed. I checked the properties of the Outlook.exe and found that my Outlook had been updated on 01/09/2024 to build 17126.20132.
The first few lines of the received message look like this instead of displaying the HTML body properly:
Date: Sat, 27 Jan 2024 09:49:07 -0500 Message-ID: <001401da512f$fbfe22e0$f3fa68a0$@yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0015_01DA5106.132841F0" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdpRL+CLDwHNFptQRByy4dYfv3ajqg== Content-Language: en-us This is a multipart message in MIME format. ------=_NextPart_000_0015_01DA5106.132841F0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit
_____________________________________________________
Sample section of VBA Macro:
Set objOutlook = CreateObject("Outlook.Application") Set objMail = objOutlook.CreateItem(olMailItem) With objMail .To = EMAILACCOUNT .BCC = strEmailAddresses .Subject = GetSubject() .Body = GetBody() .BodyFormat = olFormatHTML .HTMLBody = GetBody() .SendUsingAccount = objOutlook.Session.Accounts.Item(lngAccountID) .DeferredDeliveryTime = CDate(DeferDateTime) .Importance = olImportanceNormal End With If Testing Then objMail.Save ' Save to Drafts Folder Else objMail.Send End If
____________________________________________________
Office 2019 16.0.17126.20132
Windows 11 Pro
Version 23H2
OS build 22631.2861
Experience Windows Feature Experience Pack 1000.22681.1000.0