CDONTS.NewMail Object and Windows Server 2003

Discussion in 'ASP General' started by Paul, Jan 25, 2005.

  1. Paul

    Paul Guest

    I am using the CDONTS.NewMail object to send e-mail programmatically.

    We upgraded our IIS server from NT to Windows 2003 Server.

    Now it does not appear that the CDONTS object is available on the 2003
    Server?

    Is this correct?

    If so, how does one send e-mail programmatically on 2003 Server using
    "Classic ASP" (not .NET). Which object do I use?

    TIA
    Paul, Jan 25, 2005
    #1
    1. Advertising

  2. Paul

    McKirahan Guest

    "Paul" <> wrote in message
    news:...
    > I am using the CDONTS.NewMail object to send e-mail programmatically.
    >
    > We upgraded our IIS server from NT to Windows 2003 Server.
    >
    > Now it does not appear that the CDONTS object is available on the 2003
    > Server?
    >
    > Is this correct?
    >
    > If so, how does one send e-mail programmatically on 2003 Server using
    > "Classic ASP" (not .NET). Which object do I use?
    >
    > TIA
    >
    >


    Try CDO.Message (I think).
    McKirahan, Jan 25, 2005
    #2
    1. Advertising

  3. Paul

    Mark Schupp Guest

    http://www.aspfaq.com/show.asp?id=2026

    --
    --Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com

    "Paul" <> wrote in message
    news:...
    >I am using the CDONTS.NewMail object to send e-mail programmatically.
    >
    > We upgraded our IIS server from NT to Windows 2003 Server.
    >
    > Now it does not appear that the CDONTS object is available on the 2003
    > Server?
    >
    > Is this correct?
    >
    > If so, how does one send e-mail programmatically on 2003 Server using
    > "Classic ASP" (not .NET). Which object do I use?
    >
    > TIA
    >
    >
    Mark Schupp, Jan 25, 2005
    #3
  4. Paul

    Dr. Know Guest

    Paul said:

    >I am using the CDONTS.NewMail object to send e-mail programmatically.
    >
    >We upgraded our IIS server from NT to Windows 2003 Server.
    >
    >Now it does not appear that the CDONTS object is available on the 2003
    >Server?
    >
    >Is this correct?
    >
    >If so, how does one send e-mail programmatically on 2003 Server using
    >"Classic ASP" (not .NET). Which object do I use?


    Hey! This is one I can answer!

    This is a code snippet from a previous project - I became quite
    familiar with CDOSYS when writing ACCESS Report E-Mail apps.
    Replace variables appropriately.

    Also, this routine uses cdoSendUsingPort, you might want to rewrite it
    so that it uses the local drop directory instead. This was done for a
    user who wanted to send e-mail through his local ISP account instead
    of MS IIS SMTP.

    Enjoy it, I've got lots of hours into figuing this stuff out!

    Greg

    ---------------------------------------

    Function SendReport( mSStr)
    On Error GoTo 0
    Dim mobjFlds
    Dim mobjConf
    Dim mobjMail
    Dim strRet

    strRet = ""
    Set mobjConf = CreateObject("CDO.Configuration")
    Set mobjFlds = mobjConf.Fields
    With mobjFlds
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPConnectionTimeout) = 60
    .Item(cdoSMTPAuthenticate) = cdoBasic
    .Item(cdoSMTPServer) = SMSERVER
    .Item(cdoSMTPServerPort) = SMSERVERPORT
    .Item(cdoSendUserName) = SMAUTHUSER
    .Item(cdoSendPassword) = SMAUTHPASS
    .Update
    End With
    Set mobjMail = CreateObject("CDO.Message")
    mobjMail.Configuration = mobjConf
    mobjMail.Fields(cdoImportance) = 1
    mobjMail.Fields("urn:schemas:mailheader:X-MSMail-Priority") = 1
    mobjMail.Fields("urn:schemas:mailheader:X-Mailer") = "Automated
    ASP Report Mailer (c)2004 by D.G. Gillilan"
    mobjMail.Fields.Update
    mobjMail.From = "Mailer Daemon <" & SMEMAIL & ">"
    mobjMail.To = SMEMAIL
    mobjMail.ReplyTo = SMEMAIL
    mobjMail.Subject = SMCOMPANY
    mobjMail.AutoGenerateTextBody = False
    mobjMail.MimeFormatted = False
    mobjMail.TextBody = SMCOMPANY & vbCrLf & mSstr
    on error resume next
    mobjMail.Send
    if err.number <> 0 then
    Select Case err.Number
    Case -2147220973
    strRet = " Failure to Send Report Message -
    Server Not Found" & vbCrLf & " Error: " & err.Number & " - " &
    err.Description
    Case -2147220975
    strRet = " Failure to Send Report Message -
    Server Authentication Failed" & vbCrLf & " Error: " & err.Number & "
    - " & err.Description
    Case Else
    strRet = " Failure to Send Report Message -
    Error: " & err.Number & " - " & err.Description
    End Select
    end if
    on error goto 0
    Set mobjConf = Nothing
    Set mobjFlds = Nothing
    Set mobjMail = Nothing
    SendReport = strRet

    End Function



    Dr. Know
    Dr. Know, Jan 25, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George Viveiros

    Send Method (CDONTS NewMail Object)

    George Viveiros, Nov 17, 2003, in forum: ASP General
    Replies:
    6
    Views:
    126
    Ray at
    Nov 18, 2003
  2. aa
    Replies:
    1
    Views:
    159
    [ + 2 0 r p 3 ]
    May 13, 2004
  3. Saya
    Replies:
    0
    Views:
    123
  4. Chris
    Replies:
    1
    Views:
    227
    Aaron [SQL Server MVP]
    Aug 5, 2004
  5. haode
    Replies:
    0
    Views:
    104
    haode
    Aug 31, 2004
Loading...

Share This Page