entete eBusiness.be
imagegauche
 
 




La FAQ eBusiness

FAQ  > Programming and technique  > ASP > Sending mail using CDONTS components doesn’t work. Why?

The library necessary for CDONTS functioning is no longer provided with windows 2003 / IIS.
You have to use the CDO component to send a mail.

Here is an example of a script used in replacement of the CDONTS script:


<%
Set objErrMail= Server.CreateObject("CDO.Message")
    With objErrMail
         .From = "From Address<from@domain.com>"
         .To = "recipient@domain.com"
         .Subject = "Subject Line"
         .HTMLBody = CStr("" & strBody)
         .Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
         .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/ smtpserver") = "IP of smtp server"
         .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/ smtpserverport") = 25
         .Configuration.Fields.Update
         .Send
    End With
%>


rect