Tech Off Thread

20 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

CDO Problems

Back to Forum: Tech Off
  • User profile image
    W3bbo

    'lo

    My ASP.NET apps are having problems using CDO, as does my "normal" ASP scripts.

    ASP.NET returns an Exception saying "Could not access 'CDO.Message' object"

    ASP returns "Access Denied" for the line number the .Send() method for "CDO.Message"

    There is an Exchange Server running on the same system, and I've never had this problem before. Any ideas?

  • User profile image
    dotnetjunkie

    Yes, I've had this problem once before, but it's not worth fixing it because you shouldn't be using CDO any more, it is deprecated...

  • User profile image
    W3bbo

    dotnetjunkie wrote:
    Yes, I've had this problem once before, but it's not worth fixing it because you shouldn't be using CDO any more, it is deprecated...


    No, that's CDONTS, CDO(SYS) is the "new" one.

  • User profile image
    Red5

    Possibly a security issue with the user that is running the ASP.NET worker process.  Out of the box on Win2000, that the ASPNET user.  I forget who it is on Server 2003.  I would start there.  Maybe ASPNET needs to be added to your Exchange accounts.

  • User profile image
    Red5

    I tried pinging w3bdevil.com and my request timed out.
    Could be your provider rejects pings.
    Is your server down or does your provider reject requests for email validations?
    Maybe you can tell CDO not to validate an email address if that's the problem.

  • User profile image
    Maurits

    Weird... it's almost like there's an anonymous proxy intercepting SMTP connections.  But if it doesn't understand RCPT TO, how useful could it be...

    Try putting a space after the colon.

    EDIT: Are you copy/pasting the command (right-click to paste in a command prompt) or typing it in manually?  If you're typing it in manually, be aware the characters are sent in real-time so Backspace won't do you any good if you make a typo.

  • User profile image
    Maurits

    W3bbo wrote:

    <D001109687E83bu92Zs00000001@d001109687e83.XXX.YYY>


    That's the Message ID - so Exchange accepted the message, so you should have received the email.  Assuming you did, that means something must be wrong with CDO.  Do you specify a server?  Should be "localhost" I think.

  • User profile image
    W3bbo

    Maurits wrote:
    That's the Message ID - so Exchange accepted the message, so you should have received the email.  Assuming you did, that means something must be wrong with CDO.  Do you specify a server?  Should be "localhost" I think.


    Well, as reported earlier, CDO returns the Exceptions relating to "Rely denied". And yes, I did receive the message. System.Web.Mail.SmtpServer was set to "127.0.0.1"

  • User profile image
    Maurits

    MSDN article says:
    If the SmtpServer property is not set, by removing the line of code, the local SMTP server is used.

    Try not setting the property.

  • User profile image
    W3bbo

    Maurits wrote:
    MSDN article says:
    If the SmtpServer property is not set, by removing the line of code, the local SMTP server is used.

    Try not setting the property.


    I tried that before I set the server value.

    I don't want to get into this again, but Maurits, its already been established that the System.Web.Mail.MailMessage is reaching the server because otherwise it wouldn't through the Exception I described earlier.

  • User profile image
    Maurits

    W3bbo wrote:
    the server


    But which server, there's the rub.

    There's two possibilities:
    1) The CDO call is accessing a different server than localhost
    2) localhost is implementing different relay policies depending on whether you telnet to it locally (relay allowed) or create a CDO object locally (relay not allowed)

    Both of these are very strange.  I must admit I'm a little lost.

  • User profile image
    W3bbo

    Doesn't Exchange keep logs? I'm going to have a look.

  • User profile image
    W3bbo

    Hey Maurits, can you get on MSN Messenger at all?

  • User profile image
    Maurits

    Perhaps it's an authentication issue.  I've never had this problem but then I've never run CDO on an Exchange machine before.

    But try this:

    Basically, specify an SMTP username and password in the calling code.

  • User profile image
    W3bbo

    250 OK
     FROM: <w3bd###devil.com>
    RCPT TO: <w3bd###bdevil.com>
    250 2.1.0 w3bde###devil.com....Sender OK
    D250 2.1.5 w3bde###vil.com
    ATA
    Subject: test
    
    this is a test
    .354 Start mail input; end with <CRLF>.<CRLF>
    blargh
    
    .
    250 2.6.0 <D001109687E83bu92Zs0000###09687e83.XXX.YYY> Queued mail for delivery
    
    quit
    500 5.3.3 Unrecognized command
    


    Interesting indeed.

  • User profile image
    W3bbo

    Maurits wrote:
    If you're typing it in manually, be aware the characters are sent in real-time so Backspace won't do you any good if you make a typo.


    Yep, that t'was the problem in this case.

    Anyway, here's what happened when I did it properly:

    MAIL FROM: <w3b###devil.com>
    250 2.1.0 w3bde###evil.com....Sender OK
    RCPT TO: <w3bde###devil.com>
    250 2.1.5 w3bd###devil.com
    QUIT
    221 2.0.0 d001109687e83.XXX.YYY Service closing transmission channel
    
    
    Connection to host lost.
    
    C:\Program Files\Support Tools>
    
    

  • User profile image
    W3bbo

    Maurits wrote:
    W3bbo wrote:"The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for w3b###devil.com"


    Check your relay settings.  To do so, open a command prompt on the server and type
        telnet localhost smtp

    then enter the following one line at a time

    EHLO localhost
    MAIL FROM: <w3bde###devil.com>
    RCPT TO: <w3bde###evil.com>
    QUIT


    Here's the results:

    220 d001109687e83.XXX.YYY Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830 ready at  Fri, 12 Aug 2005 20:12:40 +0100
    EHLO localhost
    250-d001109687e83.XXX.YYY Hello [127.0.0.1]
    250-TURN
    250-SIZE
    250-ETRN
    250-PIPELINING
    250-DSN
    250-ENHANCEDSTATUSCODES
    250-8bitmime
    250-BINARYMIME
    250-CHUNKING
    250-VRFY
    250-X-EXPS GSSAPI NTLM LOGIN
    250-X-EXPS=LOGIN
    250-AUTH GSSAPI NTLM LOGIN
    250-AUTH=LOGIN
    250-X-LINK2STATE
    250-XEXCH50
    250 OK
    MAIL FROM:<w3bd###devil.com>
    250 2.1.0 w3bde###evil.com....Sender OK
    RCPT TO:<w3bde###3bdevil.com>
    500 5.3.3 Unrecognized command
    QUIT
    221 2.0.0 d00110968###er Service closing transmission channel
    
    
    Connection to host lost.
    


    Maurits wrote:
    Muck around with the settings until the RCPT TO response is an OK.


    Which settings? I've set to allow all Relay from the local box.

  • User profile image
    W3bbo

    I did a bit more Exception hunting.

    The 3rd exception in the chain (Ex.InnerException.InnerException.Message) was:

    "The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for w3bd###bdevil.com"

    Where "w3bdev####bdevil.com" is the address in the "To:" field of the System.Web.Mail.MailMessage object.

    I've never had this problem before. Any ideas?

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.