Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
1680to1684
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

CDO - SMTP Port 578 - Transport - keine Verbindung

CDO - SMTP Port 578 - Transport - keine Verbindung
28.03.2019 10:44:42
Fragstuff
Guten Morgen zusammen,
ich habe von unserer IT nun SMTP Zugangsdaten bekommen
Benutzername: DOMAIN\USERNAME
Port: 587
Sicherheit: STARTTLS
Authentifizierung: Passwort, normal
und möchte nun aus Excel heraus via der CDO Bibliothek E-Mails über den SMTP Server versenden. Den entsprechenden Verweis:
"Microsoft CDO for Windows 2000 Library"
ist aktiviert.
Habe mich auch bereits in diversen Foren schlau gemacht und komme seit heute morgen um 7 Uhr einfach auf keine Lösung und bin am verzweifeln.
Folgende Fehlermeldung erhalten ich:
"Laufzeitfehler '-2147220973 (80040213)':
Der Transport konnte keine Verbindung zum Server herstellen."

Anbei der VBA-Code:
Public Sub SMTP()
Dim iMsg As Object
Dim iConf As Object
Dim strbody As String
Dim Flds As Variant
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1    ' CDO Source Defaults
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.XXXXXXXX.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 578
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "DOMAIN\USERNAME"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "XXXXXX"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendtls") = True
.Update
End With
strbody = "Dear Madams," & vbNewLine & vbNewLine & _
"please find attached the test order overview." & vbNewLine & vbNewLine & _
"Kind Regards" & vbNewLine & vbNewLine & _
"test gmbh"
With iMsg
Set .Configuration = iConf
.To = "XXX@XXXX.com"
.CC = ""
.BCC = ""
.From = "SMTPPOSTFACH@XXXX.com"
.Subject = "Order "
.TextBody = strbody
.Send
End With
End Sub

Hat hier jemand noch einen Ratschlag den er mir mit auf den Weg geben könnte ?

5
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: CDO - SMTP Port 578 - Transport - keine Verbindung
28.03.2019 11:06:35
Werner
Hallo,
ich hab jetzt davon nicht wirklich Ahnung, aber was mir auffällt:
Dein Code:
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 578

Laut deiner Beschreibung aber Port 587
Gruß Werner
AW: CDO - SMTP Port 578 - Transport - keine Verbindung
28.03.2019 11:12:37
Fragstuff
Hallo Werner,
du hast Recht, ein Zahlendreher im VBA Code......sollte natürlich Port: 587 sein.
Habe es im VBA-Code nun geändert....es bleibt trotzdem bei dem Fehler.
AW: CDO - SMTP Port 578 - Transport - keine Verbindung
28.03.2019 11:25:21
Fragstuff
Dieser Beitrag ist noch offen
AW: CDO - SMTP Port 578 - Transport - keine Verbindung
28.03.2019 11:52:46
Luschi
Hallo Fragstuff,
Du verwendest 2 Objekte, die sich aber überhaupt nicht kennen:
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Laut Beispielen im I-Net geht es so:

Dim iMsg As Object
Set iMsg= CreateObject("CDO.message")
With iMsg.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'NTLM method
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPServer
.Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 587
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "Beutzername@domain.TLD"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "GeheimesPW"
.Update
End With
' build email parts
With iMsg
.To = strMailEmpfaenger
.From = strAbsendername & " " & strAbsendermail
.Subject = strBetreff
.TextBody = strText
.send
End With
Set iMsg= Nothing
Gruß von Luschi
aus klein-Paris
Anzeige
AW: CDO - SMTP Port 578 - Transport - keine Verbindung
28.03.2019 12:49:36
Fragstuff
Hallo Luschi,
danke für deine Empfehlung.
Diese habe ich wie folgt umgesetzt, aber leider weiterhin der selbe Fehler:
Public Sub SMTP2()
Dim iMsg As Object
Const strMailEmpfaenger = "XXXXXX@XXXXX.com"
Const strAbsendername = "XXXXXX@XXXXXX.com"
Const strBetreff = "TESTMAIL"
Const strText = "TEST"
Const strSMTPServer = "smtp.XXXXX.com"
Set iMsg = CreateObject("CDO.message")
With iMsg.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'NTLM method
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPServer
.Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 587
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
'.Item("http://schemas.microsoft.com/cdo/configuration/sendtls") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "DOMAIN\USERNAME"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "GEHEIMES PW"
.Update
End With
' build email parts
With iMsg
.To = strMailEmpfaenger
.From = strAbsendername
.Subject = strBetreff
.TextBody = strText
.Send
End With
Set iMsg = Nothing
End Sub

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige