Sep 21 2023 07:47 AM
My company is switching users from Office 2016 to Microsoft 365. I have a database that send emails out to suppliers. The code has worked fine for years. Now, after the upgrade to 365, I now get an error when sending the email (.send). The error message basically says, try again later. If I display the email then manually click send, it works.
Did something change with 365 that would cause this? My company is quite large so IT is problematic to work with. We are using a generic email account create for our department.
Any ideas would be appreciated.
Sep 26 2023 09:06 AM
Oct 02 2023 05:43 AM
I found the solution to the problem. It was not related to early or late binding.
I was using outlook.mailitem.to in order to add the email addresses. I guess there was a change and this is no longer valid.
In order to assign email address I found the following code to work. This is not the complete code.
Dim appOL As Outlook.Application
Dim objMail As Outlook.MailItem
Dim Email_Recipient As Outlook.Recipient
Set appOL = GetObject(, "Outlook.Application")
If appOL Is Nothing ThenSet appOL = CreateObject("Outlook.Application")
End If
With objMail
Set .Email_Recipient = .Recipients.Add(VendorContactEmail)
.Send
End With