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-Key: 121702

Url: https://administrator.de/contentid/121702

Printed on: April 18, 2024 at 04:04 o'clock

Member: Midnightmaster
Midnightmaster Aug 01, 2009 at 17:58:15 (UTC)
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