2009-02-24 15 views
5

Ich versuche, eine E-Mail mit ASP classic gesendet zu bekommen, und habe Probleme mit der SMTP-Konfiguration.SMTP-Konfiguration SendUsing Konfigurationswert ist ungültig mit ASP-Classic

Der Fehler:

CDO.Message.1 error '80040220' The "SendUsing" configuration value is invalid.

Der Kodex (für die E-Mail selbst):

Set objMsg = Server.CreateObject("CDO.Message") 
objMsg.From  = "[email protected].com" 
objMsg.To  = "[email protected]" 
objMsg.Subject = "Procurement Ally Update" 
objMsg.TextBody = strBody 

Der Kodex habe ich versucht, mit (pt 1) zu konfigurieren:

sch = "http://schemas.microsoft.com/cdo/configuration/" 
Set cdoConfig = CreateObject("CDO.Configuration") 
    With cdoConfig.Fields 
     .Item(sch & "smtpserver") = "127.0.0.1" 
     .update 
    End With 

That hat nicht funktioniert, also habe ich versucht:

objMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" 
objMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
objMsg.Configuration.Fields.Update 

Das hat auch nicht funktioniert.

(Ja, ich habe es nicht zeigen, aber am Ende gibt es einen Aufruf an objMsg.Send)

Soweit ich das beurteilen kann, der lokalen Boxen SMTP-Dienst ausgeführt wird und bereit ist, seine Pflicht zu tun.

Kann jemand helfen?

Antwort

16

Wenn Sie eine smptserver angeben, sollten Sie Ihre 'sendusing' Feld 2 (oder CdoSendUsingPort) sowie zu setzen:

objMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
objMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" 
objMsg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
objMsg.Configuration.Fields.Update