Jag får följande fel när jag försöker skicka mejl mha cdonts:
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/mail_test/mail.asp, line 2
Invalid ProgID. For additional information specific to this message please visit the Microsoft Online Support site located at: [url]http://www.microsoft.com/contentredirect.asp.[/url]
Filen CDONTS.dll finns i win32 mappen. Hur gör jag för att registrera om denna?
Visst ska det väl gå att använda CDONTS med en mailservern som inte är installerad på IIS:en?
Tack
Enla
Hittade detta:
CDONTS is no longer supported on W2K (your old code must have been on NT4 Server). At any rate, there is a new CDO for W2K (and above) that you'll need to use. Instead of using Server.CreateObject("CDONTS.NewMail") you have to use Server.CreateObject("CDO.Message") and Server.CreateObject("CDO.Configuration"). You should be able to look up those and get some documentation. HTH, Owen
Med cdosys kan du välja vilken mailserver du ska använda och vilka kontouppgifter som ska skicka mailet.
Tycker personligen att cdosys är bättre.
Inte för att detta svarar på din fråga men kanske får dig att tänka i andra banor.
Ett exempel:
Sub Maila()
' send by connecting to port 25 of the SMTP server
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
Dim strSmartHost
Dim obj
Const cdoSendUsingPort = 2
StrSmartHost = "localhost"
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
' set the CDOSYS configuration fields to use port 25 on the SMTP server
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = Basic
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "mitt_epostkonto"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mittlösenord"
.Update
End With
' build for message body
sBody = ""
For Each field In Request.Form
sBody = sBody & field & ": " & Request.Form(field) & Chr(13) & Chr(10)
Next
' apply the settings to the message
With iMsg
Set .Configuration = iConf
.To = "minadress@mindomän.nu"
.Cc = "minadress_kopia@mindomän.nu"
.From = "min_avsändar_adress@mindomän.nu"
.Subject = "Min ämnesrad"
.TextBody = sBody
.Send
End With
' cleanup of variables
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
End Sub
Hoppas det hjälper istället för stjälper *ler*
139 ms totalt · 3 externa anrop · v20260731065814-full.b746b907