Code in VS don’t work perfectly on different Machines
Imports Microsoft.Office.Interop
Imports System.Data
Imports System.Text
Imports System.Drawing.Imaging
Imports System.Drawing.Printing
Imports System.Collections.Generic
Imports System
Imports System.IO
Imports System.Data.SqlClient
Imports System.Net
Imports System.Net.Mail
Imports Microsoft.Office.Interop.Outlook
Public Class fo_rechnung_strom_re
Private Sub Button9_Click(ByVal sender as System.Object, ByVal e as System.EventArgs) behandelt die Buttom9.Click
‘ Creating an Outlook application
Dimmen outlookApp als Anwendung = Neue Anwendung()
‘ create a new mail
Dim mailItem As MailItem = CType(outlookApp.CreateItem(OlItemType.olMailItem), MailItem)
‘ Setting the email properties
mailItem.Subject = “TEST”
mailItem.Body = “This is a message from VB.NET von VB.Net.”
mailItem.To = “email address removed for privacy reasons”
‘ send mail
mailItem.Send()
‘ confirmation message
Console.WriteLine(“E-Mail gesendet.”)
End Sub
1. Computer Configuration: WIN11 pro, .NET Framework 4.8.1, Windows Updates actual, Office 2021 installed.
The code works smoothly and as desired.
On a second, almost identical machine, the code works incorrectly. The email is moved to the ‘sent items’ folder in Outlook 2021 and sent, but shortly afterwards this error message appears:
Delivery to the following recipients or groups failed: w2kmcse@@hotmail.com The email system encountered a problem processing this message. No attempt will be made to deliver this message again.
Diagnoseinformationen für Administratoren:
Generierender Server: VE1P194MB0960.EURP194.PROD.OUTLOOK.COM
email address removed for privacy reasons
Der Remote-Server hat ‘554 5.6.0 STOREDRV zurückgegeben. Senden.Exception:CorruptDataException; Fehler beim Verarbeiten der Nachricht aufgrund einer dauerhaften Ausnahme mit der Meldung [BeginDiagnosticData]Die Speicher-ID ‘AAAAAKknjf6GJPNBonv6BNGUiEgkASAA’ mit dem Typ ‘Ordner’ ist keine ID eines Ordners, Elements oder Postfachs. CorruptDataException: Die Speicher-ID “AAAAAKknjf6GJPNBonv6BNGUiEgkASAA” mit dem Typ “Folder” ist keine ID eines Ordners, Elements oder Postfachs. [EndDiagnosticData]”
Ursprüngliche Nachrichtenkopfzeilen:
Received: from VE1P194MB0960.EURP194.PROD.OUTLOOK.COM ([fe80::175d:76cd:273d:b215]) by VE1P194MB0960.EURP194.PROD.OUTLOOK.COM ([fe80::175d:76cd:273d:b215%7]) with mapi id 15.20.8026.016; Fri, 4 Oct 2024 10:21:37 +0000MIME-Version: 1.0Content-Type: text/plainDate: Fri, 4 Oct 2024 10:21:37 +0000Message-ID: <email address removed for privacy reasons>Subject: Test E-Mail
2. Computer Configuration: WIN11 home, .NET Framework 4.8.1, Windows Updates actual, Office 2021 installed.
The code is faulty! Could it be due to the version difference WIN 11 pro vs WIN 11 home?
Imports Microsoft.Office.InteropImports System.DataImports System.TextImports System.Drawing.ImagingImports System.Drawing.PrintingImports System.Collections.GenericImports SystemImports System.IOImports System.Data.SqlClientImports System.NetImports System.Net.MailImports Microsoft.Office.Interop.OutlookPublic Class fo_rechnung_strom_re Private Sub Button9_Click(ByVal sender as System.Object, ByVal e as System.EventArgs) behandelt die Buttom9.Click ‘ Creating an Outlook application Dimmen outlookApp als Anwendung = Neue Anwendung() ‘ create a new mail Dim mailItem As MailItem = CType(outlookApp.CreateItem(OlItemType.olMailItem), MailItem) ‘ Setting the email propertiesmailItem.Subject = “TEST”mailItem.Body = “This is a message from VB.NET von VB.Net.”mailItem.To = “email address removed for privacy reasons” ‘ send mail mailItem.Send() ‘ confirmation messageConsole.WriteLine(“E-Mail gesendet.”) End Sub 1. Computer Configuration: WIN11 pro, .NET Framework 4.8.1, Windows Updates actual, Office 2021 installed.The code works smoothly and as desired. On a second, almost identical machine, the code works incorrectly. The email is moved to the ‘sent items’ folder in Outlook 2021 and sent, but shortly afterwards this error message appears:Delivery to the following recipients or groups failed: w2kmcse@@hotmail.com The email system encountered a problem processing this message. No attempt will be made to deliver this message again.Diagnoseinformationen für Administratoren:Generierender Server: VE1P194MB0960.EURP194.PROD.OUTLOOK.COMemail address removed for privacy reasonsDer Remote-Server hat ‘554 5.6.0 STOREDRV zurückgegeben. Senden.Exception:CorruptDataException; Fehler beim Verarbeiten der Nachricht aufgrund einer dauerhaften Ausnahme mit der Meldung [BeginDiagnosticData]Die Speicher-ID ‘AAAAAKknjf6GJPNBonv6BNGUiEgkASAA’ mit dem Typ ‘Ordner’ ist keine ID eines Ordners, Elements oder Postfachs. CorruptDataException: Die Speicher-ID “AAAAAKknjf6GJPNBonv6BNGUiEgkASAA” mit dem Typ “Folder” ist keine ID eines Ordners, Elements oder Postfachs. [EndDiagnosticData]”Ursprüngliche Nachrichtenkopfzeilen:Received: from VE1P194MB0960.EURP194.PROD.OUTLOOK.COM ([fe80::175d:76cd:273d:b215]) by VE1P194MB0960.EURP194.PROD.OUTLOOK.COM ([fe80::175d:76cd:273d:b215%7]) with mapi id 15.20.8026.016; Fri, 4 Oct 2024 10:21:37 +0000MIME-Version: 1.0Content-Type: text/plainDate: Fri, 4 Oct 2024 10:21:37 +0000Message-ID: <email address removed for privacy reasons>Subject: Test E-Mail2. Computer Configuration: WIN11 home, .NET Framework 4.8.1, Windows Updates actual, Office 2021 installed.The code is faulty! Could it be due to the version difference WIN 11 pro vs WIN 11 home? Read More