Could not access 'CDO.Message' object

Discussion in 'ASP .Net' started by Nathan Alden, Jun 25, 2003.

  1. Nathan Alden

    Nathan Alden Guest

    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, Jun 25, 2003
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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, Jun 25, 2003
    #2
    1. Advertising

  3. Nathan Alden

    Nathan Alden Guest

    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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    > > 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, Jun 25, 2003
    #3
  4. 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 blows 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
    "undocumented feature".

    I'm at a complete loss.

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

    Thanks.

    -Brenton


    "Nathan Alden" <> wrote in message news:<>...
    > 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" <> wrote in message
    > news:...
    > > 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" <> wrote in message
    > > news:...
    > > > 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, Jul 3, 2003
    #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. Anthony Fine
    Replies:
    3
    Views:
    3,185
    Jure Spik
    Feb 12, 2004
  2. Lars-Erik Aabech

    Could not access 'CDO.Message' object

    Lars-Erik Aabech, Mar 3, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,784
    Henrik_the_boss
    Mar 4, 2004
  3. Kamal
    Replies:
    1
    Views:
    525
  4. Desmond
    Replies:
    2
    Views:
    1,718
    David Waz...
    Jul 11, 2003
  5. Adam Knight
    Replies:
    1
    Views:
    1,119
    Ken Cox - Microsoft MVP
    Dec 5, 2005
Loading...

Share This Page