Using CDONTS Basic question

Last post 12-04-2008 4:15 PM by chas. 9 replies.

Sort Posts:

  • Using CDONTS Basic question

    12-03-2008, 5:25 PM
    • Member
      10 point Member
    • chas
    • Member since 11-10-2008, 9:52 PM
    • Posts 38

    I have a hosting site that supports CDONTS.  I am writting my code mostly in C# for ASP.NET.  When  I look up CDONTS I can not find any C# code.  Here is a code example I have found.

     Dim MyBody
    Dim MyCDONTSMail

    Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
    MyCDONTSMail.From= "regent@mypacks.net"
    MyCDONTSMail.To= "dogy@mypacks.net"
    MyCDONTSMail.Subject="sending email"
    MyBody = "will it work"
    MyCDONTSMail.Body= MyBody
    MyCDONTSMail.Send

    set MyCDONTSMail=nothing
    alert ("sent?")

     

    Where should I put code like this? Embeded in HTML or on the server side?  Is it VB (Visual Basic) code?  

    When I try it as VB.net code I get errors like:

    Error    41    Type 'CDONTS.NewMail' is not defined.    C:\Users\charles\Documents\Visual Studio 2008\WebSites\MC4HA\TryBasicMail.aspx.vb    6    23    C:\...\MC4HA\

    Is there some way to get CDONTS.NewMail defined? 

    Thanks,

    Chas

     

  • Re: Using CDONTS Basic question

    12-03-2008, 5:57 PM
    • Participant
      1,165 point Participant
    • exuviae
    • Member since 11-22-2008, 4:23 AM
    • LA
    • Posts 220

    It is VB code, and you are getting the errors because you need to add a reference to the CDONTS mail package (i assume it is code you got from somewhere else) then you will need to add an import in your .vb file.

     

    something like this for example:

    Imports CDONTS;


    Chris Dupuy

    Sr. Developer

    Blue Cross/Blue Shield LA



    * Please remember to click Mark as Answer on this post if it helped you *
  • Re: Using CDONTS Basic question

    12-03-2008, 6:55 PM
    Answer
    • Contributor
      2,184 point Contributor
    • devcalpoly
    • Member since 10-08-2007, 10:03 PM
    • Southern California
    • Posts 352

     Seems like you are missing a reference to CDONTS library.

    Are you using ASP.NET 2.0? if so, try System.Net.Mail namespace. Fairly easy to send emails via System.Net.Mail

    Dev
  • Re: Using CDONTS Basic question

    12-03-2008, 8:15 PM
    • Member
      10 point Member
    • chas
    • Member since 11-10-2008, 9:52 PM
    • Posts 38

    I'm using 3.5.  Will that work with a host server that supports CDONTS?

    Thanks,

    Chas

    devcalpoly:

     Seems like you are missing a reference to CDONTS library.

    Are you using ASP.NET 2.0? if so, try System.Net.Mail namespace. Fairly easy to send emails via System.Net.Mail


  • Re: Using CDONTS Basic question

    12-03-2008, 8:17 PM
    • Member
      10 point Member
    • chas
    • Member since 11-10-2008, 9:52 PM
    • Posts 38

    If i just do that : Imports CDONTS;

    I get : Name space doesn't have anything in it. (paraphrase)

    Is CDONTS directly supported in Visual Studio or do I need a third party library to supply CDONTS?
    Thanks,

    Chas

    exuviae:

    It is VB code, and you are getting the errors because you need to add a reference to the CDONTS mail package (i assume it is code you got from somewhere else) then you will need to add an import in your .vb file.

     

    something like this for example:

    Imports CDONTS;

     
  • Re: Using CDONTS Basic question

    12-04-2008, 1:59 AM
    Answer
    • All-Star
      17,627 point All-Star
    • imran_ku07
    • Member since 06-04-2008, 1:21 PM
    • KARACHI, PAKISTAN
    • Posts 3,236

     IN VS View > Object browser type CDONTS if it is present it shows

  • Re: Using CDONTS Basic question

    12-04-2008, 1:42 PM
    • Member
      10 point Member
    • chas
    • Member since 11-10-2008, 9:52 PM
    • Posts 38

    Right, its not there. I got what I needed using MailMessage.

    Thanks so much for your help.

    Chas

     

    imran_ku07:

     IN VS View > Object browser type CDONTS if it is present it shows

     
  • Re: Using CDONTS Basic question

    12-04-2008, 1:44 PM
    • Member
      10 point Member
    • chas
    • Member since 11-10-2008, 9:52 PM
    • Posts 38

     Yes, I got it tow rok that way. Thanks, Chas

  • Re: Using CDONTS Basic question

    12-04-2008, 4:05 PM
    • All-Star
      77,930 point All-Star
    • jeff@zina.com
    • Member since 09-26-2003, 10:43 AM
    • Naples, FL, USA
    • Posts 10,599
    • Moderator
      TrustedFriends-MVPs

    Stop using CDONTS.  It's old, deprecated and doesn't exist on new servers.  Use CDO, or better, see:

    www.sytemnetmail.com

    Jeff

    Blatant Self Promotion: ASP.NET 3.5 CMS Development
  • Re: Using CDONTS Basic question

    12-04-2008, 4:15 PM
    • Member
      10 point Member
    • chas
    • Member since 11-10-2008, 9:52 PM
    • Posts 38

    Thanks, I think you meant http://www.systemnetmail.com/.

    Chas

     

    jeff@zina.com:

    Stop using CDONTS.  It's old, deprecated and doesn't exist on new servers.  Use CDO, or better, see:

    www.sytemnetmail.com

    Jeff

Page 1 of 1 (10 items)