midnightmaster
Goto Top

CDO.Email the smtp server name is required, and was not found in the configuration source

Hi!

Ich möchte mit VB6 eine Email versenden, was bei mir unter Win XP auch wunderbar funktioniert.
Wenn ich das Programm allerdings in meiner Firma unter Win2000 starte erhalte ich folgende
Fehlermeldung:

8004020a the smtp server name is required, and was not found in the configuration source

Hab schon gegoogelt, aber außer "Mache aus SMTPServer -> smtpserver" nichts
verwertbares herausgefunden:

Dim iMsg As CDO.Message
Set iMsg = New CDO.Message
iMsg.From = Environ$("ComputerName") + "@xxx.de"  
iMsg.Subject = Text1
iMsg.To = "xxxxxx@versanet.de"  
iMsg.HTMLBody = Text2

iMsg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing").Value = 2  

iMsg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport").Value = 25  

iMsg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver ").Value = "smtp.versatel.de"  

iMsg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername").Value = "HansM"  

iMsg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword").Value = "xxxxx"  

iMsg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate").Value = "0"  

iMsg.Configuration.Fields.Update

iMsg.Send

Gruß
Midnightmaster

Content-ID: 121702

Url: https://administrator.de/forum/cdo-email-the-smtp-server-name-is-required-and-was-not-found-in-the-configuration-source-121702.html

Ausgedruckt am: 19.02.2025 um 23:02 Uhr

Midnightmaster
Midnightmaster 01.08.2009 um 19:58:15 Uhr
Goto Top
Wen es interessiert, hab das Problem allein gelöst:

Anscheinend greift CDO auf die Daten des Outlook Accounts in der Registry zu.
Also die Zeile 12 ändern in:

iMsg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver ").Value = "localhost"

Wenn man auf einem anderen Rechner das Programm benutzen will, muß man den jeweiligen Account
aus der Registry Exportieren und die Reg-Datei auf dem Fremdrechner Importieren. Dieser ist dann
natürlich unter Outlook einsehbar...

HKEY_CURRENT_USER\(Hier stehen manchmal merkwürdige Zahlen)\Software\Microsoft\Internet Account Manager\Accounts\

Gruß
Midnightmaster