Professional Web Applications Themes

Could not access 'CDO.Message' object - ASP.NET General

I've already searched Google. I've already asked people in IRC. I have still not found a solution that works for me for this extremely discouraging apparent bug in the SmtpMail class. MailMessage message = new MailMessage(); // set params here SmtpMail.SmtpServer = "mail.myispmailserver.com"; SmtpMail.Send(message); This works if I run it in a console application on my Windows Server 2003 box. However if I execute the *exact same code* from my ASP.NET application I receive the error message in the subject line. I have heard various "fixes" for this, including setting permissions on mailroot, and "explanations," including "the process ASP.NET serves ...

  1. #1

    Default Could not access 'CDO.Message' object

    I've already searched Google. I've already asked people in IRC. I have still
    not found a solution that works for me for this extremely discouraging
    apparent bug in the SmtpMail class.

    MailMessage message = new MailMessage();
    // set params here
    SmtpMail.SmtpServer = "mail.myispmailserver.com";
    SmtpMail.Send(message);

    This works if I run it in a console application on my Windows Server 2003
    box. However if I execute the *exact same code* from my ASP.NET application
    I receive the error message in the subject line.

    I have heard various "fixes" for this, including setting permissions on
    mailroot, and "explanations," including "the process ASP.NET serves pages
    under is not allowed to create sockets except to localhost."

    Will someone, preferrably from Microsoft, please tell me why this error
    occurs (the REAL reason) and what I can do to get around it? Using an SMTP
    virtual server on this box is undesirable.

    Thanks.

    Nathan Alden
    MCSD


    Nathan Alden Guest

  2. #2

    Default Re: Could not access 'CDO.Message' object

    Nathan,


    I had the same problem, after checking the innerExceptions I found out that
    this is a problem of the mailserver not allowing you to relay e-mail. Check
    your inner exceptions,
    Dim sw As New System.IO.StreamWriter("<YourWebLocation>\err.log" , True)

    sw.WriteLine("Error " & vbCrLf & vbCrLf & ex.Message)
    sw.WriteLine("InnerException 1 = " & vbCrLf & vbCrLf &
    ex.InnerException.Message)
    sw.WriteLine("InnerException 2 = " & vbCrLf & vbCrLf &
    ex.InnerException.InnerException.Message)
    sw.Close()

    if there is a relay problem then DON'T set the smtpServer property, just dot
    it like this :

    MailMessage message = new MailMessage();
    // set params here
    // SmtpMail.SmtpServer = "mail.myispmailserver.com";
    SmtpMail.Send(message);

    that worked for me !!

    Hope this helps.

    Jurjen de Groot
    G.I.T.S., Netherlands


    "Nathan Alden" <liverpghotmail.com> wrote in message
    news:eR9p8GtODHA.2316TK2MSFTNGP11.phx.gbl...
    > I've already searched Google. I've already asked people in IRC. I have
    still
    > not found a solution that works for me for this extremely discouraging
    > apparent bug in the SmtpMail class.
    >
    > MailMessage message = new MailMessage();
    > // set params here
    > SmtpMail.SmtpServer = "mail.myispmailserver.com";
    > SmtpMail.Send(message);
    >
    > This works if I run it in a console application on my Windows Server 2003
    > box. However if I execute the *exact same code* from my ASP.NET
    application
    > I receive the error message in the subject line.
    >
    > I have heard various "fixes" for this, including setting permissions on
    > mailroot, and "explanations," including "the process ASP.NET serves pages
    > under is not allowed to create sockets except to localhost."
    >
    > Will someone, preferrably from Microsoft, please tell me why this error
    > occurs (the REAL reason) and what I can do to get around it? Using an SMTP
    > virtual server on this box is undesirable.
    >
    > Thanks.
    >
    > Nathan Alden
    > MCSD
    >
    >

    Jurjen de Groot Guest

  3. #3

    Default Re: Could not access 'CDO.Message' object

    Yes actually I had investigated the InnerExceptions and I've found it's
    anything from 451 responses (LF only not allowed) to "cannot connect" etc.

    "Jurjen de Groot" <infogits-online.nl> wrote in message
    news:O2LwasvODHA.3088TK2MSFTNGP10.phx.gbl...
    > Nathan,
    >
    >
    > I had the same problem, after checking the innerExceptions I found out
    that
    > this is a problem of the mailserver not allowing you to relay e-mail.
    Check
    > your inner exceptions,
    > Dim sw As New System.IO.StreamWriter("<YourWebLocation>\err.log" , True)
    >
    > sw.WriteLine("Error " & vbCrLf & vbCrLf & ex.Message)
    > sw.WriteLine("InnerException 1 = " & vbCrLf & vbCrLf &
    > ex.InnerException.Message)
    > sw.WriteLine("InnerException 2 = " & vbCrLf & vbCrLf &
    > ex.InnerException.InnerException.Message)
    > sw.Close()
    >
    > if there is a relay problem then DON'T set the smtpServer property, just
    dot
    > it like this :
    >
    > MailMessage message = new MailMessage();
    > // set params here
    > // SmtpMail.SmtpServer = "mail.myispmailserver.com";
    > SmtpMail.Send(message);
    >
    > that worked for me !!
    >
    > Hope this helps.
    >
    > Jurjen de Groot
    > G.I.T.S., Netherlands
    >
    >
    > "Nathan Alden" <liverpghotmail.com> wrote in message
    > news:eR9p8GtODHA.2316TK2MSFTNGP11.phx.gbl...
    > > I've already searched Google. I've already asked people in IRC. I have
    > still
    > > not found a solution that works for me for this extremely discouraging
    > > apparent bug in the SmtpMail class.
    > >
    > > MailMessage message = new MailMessage();
    > > // set params here
    > > SmtpMail.SmtpServer = "mail.myispmailserver.com";
    > > SmtpMail.Send(message);
    > >
    > > This works if I run it in a console application on my Windows Server
    2003
    > > box. However if I execute the *exact same code* from my ASP.NET
    > application
    > > I receive the error message in the subject line.
    > >
    > > I have heard various "fixes" for this, including setting permissions on
    > > mailroot, and "explanations," including "the process ASP.NET serves
    pages
    > > under is not allowed to create sockets except to localhost."
    > >
    > > Will someone, preferrably from Microsoft, please tell me why this error
    > > occurs (the REAL reason) and what I can do to get around it? Using an
    SMTP
    > > virtual server on this box is undesirable.
    > >
    > > Thanks.
    > >
    > > Nathan Alden
    > > MCSD
    > >
    > >
    >
    >

    Nathan Alden Guest

  4. #4

    Default Re: Could not access 'CDO.Message' object

    Has anyone resolved this issue?

    Our development server has migrated to another network, and now
    resides as a DMZ. From the exact same box, "old" asp code can send
    emails perfectly, i have spent a little over 6 hours trying to resolve
    this problem trying everything mentioned in every google thread
    pertinent to this problem. Before the migration, we were able to send
    emails out. Now, nothing I do configuration wise seems to work.

    Things I've tried:
    -Changing permissions on every dll related to CDO
    -Changing permissions on every directory related
    -Changing relay options
    -Changing smtp servers
    -Impersonation for the aspnet_wp application in web.config
    -changing machine.config

    ASP.NET s if it can't handle such a simple task. Why is this so
    difficult? Where is microsoft to step in and enlighten us on this
    "undoented feature".

    I'm at a complete loss.

    Anyone with the solution, please let me/the world know.

    Thanks.

    -Brenton


    "Nathan Alden" <liverpghotmail.com> wrote in message news:<u6bIIqxODHA.2248TK2MSFTNGP11.phx.gbl>...
    > Yes actually I had investigated the InnerExceptions and I've found it's
    > anything from 451 responses (LF only not allowed) to "cannot connect" etc.
    >
    > "Jurjen de Groot" <infogits-online.nl> wrote in message
    > news:O2LwasvODHA.3088TK2MSFTNGP10.phx.gbl...
    > > Nathan,
    > >
    > >
    > > I had the same problem, after checking the innerExceptions I found out
    > that
    > > this is a problem of the mailserver not allowing you to relay e-mail.
    > Check
    > > your inner exceptions,
    > > Dim sw As New System.IO.StreamWriter("<YourWebLocation>\err.log" , True)
    > >
    > > sw.WriteLine("Error " & vbCrLf & vbCrLf & ex.Message)
    > > sw.WriteLine("InnerException 1 = " & vbCrLf & vbCrLf &
    > > ex.InnerException.Message)
    > > sw.WriteLine("InnerException 2 = " & vbCrLf & vbCrLf &
    > > ex.InnerException.InnerException.Message)
    > > sw.Close()
    > >
    > > if there is a relay problem then DON'T set the smtpServer property, just
    > dot
    > > it like this :
    > >
    > > MailMessage message = new MailMessage();
    > > // set params here
    > > // SmtpMail.SmtpServer = "mail.myispmailserver.com";
    > > SmtpMail.Send(message);
    > >
    > > that worked for me !!
    > >
    > > Hope this helps.
    > >
    > > Jurjen de Groot
    > > G.I.T.S., Netherlands
    > >
    > >
    > > "Nathan Alden" <liverpghotmail.com> wrote in message
    > > news:eR9p8GtODHA.2316TK2MSFTNGP11.phx.gbl...
    > > > I've already searched Google. I've already asked people in IRC. I have
    > still
    > > > not found a solution that works for me for this extremely discouraging
    > > > apparent bug in the SmtpMail class.
    > > >
    > > > MailMessage message = new MailMessage();
    > > > // set params here
    > > > SmtpMail.SmtpServer = "mail.myispmailserver.com";
    > > > SmtpMail.Send(message);
    > > >
    > > > This works if I run it in a console application on my Windows Server
    > 2003
    > > > box. However if I execute the *exact same code* from my ASP.NET
    > application
    > > > I receive the error message in the subject line.
    > > >
    > > > I have heard various "fixes" for this, including setting permissions on
    > > > mailroot, and "explanations," including "the process ASP.NET serves
    > pages
    > > > under is not allowed to create sockets except to localhost."
    > > >
    > > > Will someone, preferrably from Microsoft, please tell me why this error
    > > > occurs (the REAL reason) and what I can do to get around it? Using an
    > SMTP
    > > > virtual server on this box is undesirable.
    > > >
    > > > Thanks.
    > > >
    > > > Nathan Alden
    > > > MCSD
    > > >
    > > >
    > >
    > >
    Brenton Unger Guest

  5. #5

    Default Could not access 'CDO.Message' object

    Hi

    I'm getting the following message when I try to send an email from an aspx
    page

    Could not access 'CDO.Message' object

    .... but it only occures on one my machine. It works fine on my development
    computer.


    Can anyone give me a hint?

    //peterbladh


    Peter Guest

  6. #6

    Default Re: Could not access 'CDO.Message' object

    It sounds as if CDO might not even be installed on the machine in question.
    This is possible depending on what operating system / software is installed.
    CDO is included with a lot of things, but not everything.

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "Peter Bladh" <se> wrote in message
    news:phx.gbl... 


    S. Guest

  7. #7

    Default Re: Could not access 'CDO.Message' object

    It seems to be installed (cdonts.dll is there...).

    Can you think of any other reason(s)?

    //peterbladh


    "S. Justin Gengo" <com> wrote in message
    news:phx.gbl... 
    question. 
    installed. [/ref]
    aspx [/ref]
    development 
    >
    >[/ref]


    Peter Guest

  8. #8

    Default Re: Could not access 'CDO.Message' object

    Peter,

    Hmmmm, if it's there then the only other thing I can think of is if you
    aren't setting the server name.

    [Mail Object's Name].SmtpServer = "[Your Server Name]"

    Are you setting it this way?

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "Peter Bladh" <se> wrote in message
    news:phx.gbl... 
    > question. 
    > installed. [/ref]
    > aspx [/ref]
    > development 
    > >
    > >[/ref]
    >
    >[/ref]


    S. Guest

  9. #9

    Default Re: Could not access 'CDO.Message' object

    Check the Relay permissions on the SMTP server.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Neither a follower nor a lender be.

    "Peter Bladh" <se> wrote in message
    news:phx.gbl... 
    > question. 
    > installed. [/ref]
    > aspx [/ref]
    > development 
    > >
    > >[/ref]
    >
    >[/ref]


    Kevin Guest

  10. #10

    Default Re: Could not access 'CDO.Message' object

    cdonts.dll is present...

    I use an extarnal Exchange server. The dev. com puter also uses that server
    (and that works).

    //peter


    "Kevin Spencer" <com> wrote in message
    news:phx.gbl... 
    > > question. 
    > > installed. [/ref][/ref]
    an 
    > > development 
    > >
    > >[/ref]
    >
    >[/ref]


    Peter Guest

  11. #11

    Default Re: Could not access 'CDO.Message' object

    Yes, I'm setting it like that..

    //peter


    "S. Justin Gengo" <com> wrote in message
    news:phx.gbl... 
    > > question. 
    > > installed. [/ref][/ref]
    an 
    > > development 
    > >
    > >[/ref]
    >
    >[/ref]


    Peter Guest

  12. #12

    Default SOLVED

    It was a firewall related problem.

    Thanks anyway!

    //peterbladh

    "Peter Bladh" <se> wrote in message
    news:#phx.gbl... 
    server [/ref]
    > an 
    > >
    > >[/ref]
    >
    >[/ref]


    Peter Guest

Similar Threads

  1. Replies: 2
    Last Post: May 1st, 01:19 PM
  2. Serialize object method to soap message?
    By RA in forum ASP.NET Web Services
    Replies: 0
    Last Post: April 29th, 02:29 AM
  3. Replies: 2
    Last Post: February 16th, 06:40 PM
  4. Access denied when creating Access application object
    By Bill Murphy in forum ASP Database
    Replies: 7
    Last Post: July 31st, 05:37 PM
  5. Could not access CDO.Message object in IIS6.0
    By Desmond in forum ASP.NET Security
    Replies: 3
    Last Post: July 11th, 06:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139