Urgent SendMail Problem

Discussion in 'ASP .Net' started by Andrea Williams, Dec 9, 2004.

  1. I have been using this code for a while now and I haven't changed this code
    for at least a couple weeks... I do not suspect the code. The error I'm
    getting is the following:

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

    StackTrace: at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj,
    String methodName, Object[] args)
    at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
    at System.Web.Mail.CdoSysHelper.Send(String from, String to, String subject,
    String messageText)
    at System.Web.Mail.SmtpMail.Send(String from, String to, String subject,
    String messageText)
    at DSI.CIS.UserRegister.btnSubmit_Click(Object sender, EventArgs e) in
    c:\inetpub\wwwroot\DSI\CIS\UserRegister.aspx.cs:line 524

    TargetSite: System.Object CallMethod(System.Object, System.String,
    System.Object[])

    InnerException: System.Reflection.TargetInvocationException: Exception has
    been thrown by the target of an invocation. --->
    System.Runtime.InteropServices.COMException (0x80040213): The transport
    failed to connect to the server.

    --- End of inner exception stack trace ---
    at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,
    Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
    String[] namedParameters)
    at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
    Binder binder, Object target, Object[] args, ParameterModifier[] modifiers,
    CultureInfo culture, String[] namedParameters)
    at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
    methodName, Object[] args)

    HelpLink:


    The line of code that is failing is this:
    System.Web.Mail.SmtpMail.Send(this.HomeOfficeEmail, oUser.Email,

    oEmailMessage.Subject, oEmailMessage.Body);

    I stepped through the code and all the values are correct so I can only
    assume that something is wrong with .NET itself.

    Any help would be appreciated!!!

    Andrea
     
    Andrea Williams, Dec 9, 2004
    #1
    1. Advertising

  2. Did anyone change anything on the SMTP server? The ASP.NET account could
    have expired, relaying could be turned off, the IP address could change.

    Did anyone change/uninstall CDO on the Web server or change the permissions?

    Just tossing out some ideas of things that have been known to cause problems
    with email sending.

    Ken


    "Andrea Williams" <> wrote in message
    news:...
    >I have been using this code for a while now and I haven't changed this code
    > for at least a couple weeks... I do not suspect the code. The error I'm
    > getting is the following:
    >
    > Message: Could not access 'CDO.Message' object.
    >
    > StackTrace: at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object
    > obj,
    > String methodName, Object[] args)
    > at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
    > at System.Web.Mail.CdoSysHelper.Send(String from, String to, String
    > subject,
    > String messageText)
    > at System.Web.Mail.SmtpMail.Send(String from, String to, String subject,
    > String messageText)
    > at DSI.CIS.UserRegister.btnSubmit_Click(Object sender, EventArgs e) in
    > c:\inetpub\wwwroot\DSI\CIS\UserRegister.aspx.cs:line 524
    >
    > TargetSite: System.Object CallMethod(System.Object, System.String,
    > System.Object[])
    >
    > InnerException: System.Reflection.TargetInvocationException: Exception has
    > been thrown by the target of an invocation. --->
    > System.Runtime.InteropServices.COMException (0x80040213): The transport
    > failed to connect to the server.
    >
    > --- End of inner exception stack trace ---
    > at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
    > invokeAttr,
    > Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
    > String[] namedParameters)
    > at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
    > Binder binder, Object target, Object[] args, ParameterModifier[]
    > modifiers,
    > CultureInfo culture, String[] namedParameters)
    > at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
    > methodName, Object[] args)
    >
    > HelpLink:
    >
    >
    > The line of code that is failing is this:
    > System.Web.Mail.SmtpMail.Send(this.HomeOfficeEmail, oUser.Email,
    >
    > oEmailMessage.Subject, oEmailMessage.Body);
    >
    > I stepped through the code and all the values are correct so I can only
    > assume that something is wrong with .NET itself.
    >
    > Any help would be appreciated!!!
    >
    > Andrea
    >
    >
     
    Ken Cox [Microsoft MVP], Dec 9, 2004
    #2
    1. Advertising

  3. Andrea Williams

    bruce barker Guest

    the smtp server is rejecting the connection, or is not found. check that the
    stmpp servername is valid, that is it running, allows anonymous access, and
    relaying from your asp.net server.

    -- bruce (sqlwork.com)


    "Andrea Williams" <> wrote in message
    news:...
    | I have been using this code for a while now and I haven't changed this
    code
    | for at least a couple weeks... I do not suspect the code. The error I'm
    | getting is the following:
    |
    | Message: Could not access 'CDO.Message' object.
    |
    | StackTrace: at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object
    obj,
    | String methodName, Object[] args)
    | at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
    | at System.Web.Mail.CdoSysHelper.Send(String from, String to, String
    subject,
    | String messageText)
    | at System.Web.Mail.SmtpMail.Send(String from, String to, String subject,
    | String messageText)
    | at DSI.CIS.UserRegister.btnSubmit_Click(Object sender, EventArgs e) in
    | c:\inetpub\wwwroot\DSI\CIS\UserRegister.aspx.cs:line 524
    |
    | TargetSite: System.Object CallMethod(System.Object, System.String,
    | System.Object[])
    |
    | InnerException: System.Reflection.TargetInvocationException: Exception has
    | been thrown by the target of an invocation. --->
    | System.Runtime.InteropServices.COMException (0x80040213): The transport
    | failed to connect to the server.
    |
    | --- End of inner exception stack trace ---
    | at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
    invokeAttr,
    | Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
    | String[] namedParameters)
    | at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
    | Binder binder, Object target, Object[] args, ParameterModifier[]
    modifiers,
    | CultureInfo culture, String[] namedParameters)
    | at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
    | methodName, Object[] args)
    |
    | HelpLink:
    |
    |
    | The line of code that is failing is this:
    | System.Web.Mail.SmtpMail.Send(this.HomeOfficeEmail, oUser.Email,
    |
    | oEmailMessage.Subject, oEmailMessage.Body);
    |
    | I stepped through the code and all the values are correct so I can only
    | assume that something is wrong with .NET itself.
    |
    | Any help would be appreciated!!!
    |
    | Andrea
    |
    |
     
    bruce barker, Dec 9, 2004
    #3
  4. Further investigation finds this... If I turn off the connection security
    (allow all) on the SMTP server AND allow all to relay, the Send mail works.
    However, I don't like this solution as it opens security holes big time!

    The only thing I can think of that has changed is that I installed the .NET
    1.1 SP 1 and a security patch (KB833987). I suspect it broke something.
    Before I was able to set the Connection security to only allow my IP address
    and only allow my system to relay. Now that doesn't work.

    I tried un-installing the SP for .NET, but still have the same problem. So
    I'm thinking that it changed something permenantly and uninstall didn't
    reset it.

    Incidently, if I set the Connection security to exclude all but my IP, the
    email bombs. If I open that back up and set the relay to exclude all except
    my IP it also bombs.

    Andrea

    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:...
    > Did anyone change anything on the SMTP server? The ASP.NET account could
    > have expired, relaying could be turned off, the IP address could change.
    >
    > Did anyone change/uninstall CDO on the Web server or change the

    permissions?
    >
    > Just tossing out some ideas of things that have been known to cause

    problems
    > with email sending.
    >
    > Ken
    >
    >
    > "Andrea Williams" <> wrote in message
    > news:...
    > >I have been using this code for a while now and I haven't changed this

    code
    > > for at least a couple weeks... I do not suspect the code. The error

    I'm
    > > getting is the following:
    > >
    > > Message: Could not access 'CDO.Message' object.
    > >
    > > StackTrace: at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object
    > > obj,
    > > String methodName, Object[] args)
    > > at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
    > > at System.Web.Mail.CdoSysHelper.Send(String from, String to, String
    > > subject,
    > > String messageText)
    > > at System.Web.Mail.SmtpMail.Send(String from, String to, String subject,
    > > String messageText)
    > > at DSI.CIS.UserRegister.btnSubmit_Click(Object sender, EventArgs e) in
    > > c:\inetpub\wwwroot\DSI\CIS\UserRegister.aspx.cs:line 524
    > >
    > > TargetSite: System.Object CallMethod(System.Object, System.String,
    > > System.Object[])
    > >
    > > InnerException: System.Reflection.TargetInvocationException: Exception

    has
    > > been thrown by the target of an invocation. --->
    > > System.Runtime.InteropServices.COMException (0x80040213): The transport
    > > failed to connect to the server.
    > >
    > > --- End of inner exception stack trace ---
    > > at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
    > > invokeAttr,
    > > Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
    > > String[] namedParameters)
    > > at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
    > > Binder binder, Object target, Object[] args, ParameterModifier[]
    > > modifiers,
    > > CultureInfo culture, String[] namedParameters)
    > > at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
    > > methodName, Object[] args)
    > >
    > > HelpLink:
    > >
    > >
    > > The line of code that is failing is this:
    > > System.Web.Mail.SmtpMail.Send(this.HomeOfficeEmail, oUser.Email,
    > >
    > > oEmailMessage.Subject, oEmailMessage.Body);
    > >
    > > I stepped through the code and all the values are correct so I can only
    > > assume that something is wrong with .NET itself.
    > >
    > > Any help would be appreciated!!!
    > >
    > > Andrea
    > >
    > >

    >
     
    Andrea Williams, Dec 10, 2004
    #4
  5. I installed sp1 for .NET 1.1 and a security patch (KB833987) as I have just
    told Ken Cox. The frustrating thing is that this was all working
    correctly... I seem to remember uninstalling the SP, but it didn't fix the
    problem. I was in a hurry at the time to finish up for a conference so I
    left it until I returned.

    I am the only one who modifies these servers and the Win03 box that is doing
    this is the only one where I've installed the update and the only box with
    this behavior. Since then, the live server at the ISP has started doing the
    same thing and it is a Win2K box, and doesn't need that particular security
    patch, so I suspect the Service Pack. (Read the previous post) I asure you
    that my work around for this issue will NOT work for the ISP and I can't say
    that I like it much either.

    If you have any other suggestion, please let me know,
    Andrea


    "bruce barker" <> wrote in message
    news:#e#...
    > the smtp server is rejecting the connection, or is not found. check that

    the
    > stmpp servername is valid, that is it running, allows anonymous access,

    and
    > relaying from your asp.net server.
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "Andrea Williams" <> wrote in message
    > news:...
    > | I have been using this code for a while now and I haven't changed this
    > code
    > | for at least a couple weeks... I do not suspect the code. The error

    I'm
    > | getting is the following:
    > |
    > | Message: Could not access 'CDO.Message' object.
    > |
    > | StackTrace: at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object
    > obj,
    > | String methodName, Object[] args)
    > | at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
    > | at System.Web.Mail.CdoSysHelper.Send(String from, String to, String
    > subject,
    > | String messageText)
    > | at System.Web.Mail.SmtpMail.Send(String from, String to, String subject,
    > | String messageText)
    > | at DSI.CIS.UserRegister.btnSubmit_Click(Object sender, EventArgs e) in
    > | c:\inetpub\wwwroot\DSI\CIS\UserRegister.aspx.cs:line 524
    > |
    > | TargetSite: System.Object CallMethod(System.Object, System.String,
    > | System.Object[])
    > |
    > | InnerException: System.Reflection.TargetInvocationException: Exception

    has
    > | been thrown by the target of an invocation. --->
    > | System.Runtime.InteropServices.COMException (0x80040213): The transport
    > | failed to connect to the server.
    > |
    > | --- End of inner exception stack trace ---
    > | at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
    > invokeAttr,
    > | Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
    > | String[] namedParameters)
    > | at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
    > | Binder binder, Object target, Object[] args, ParameterModifier[]
    > modifiers,
    > | CultureInfo culture, String[] namedParameters)
    > | at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
    > | methodName, Object[] args)
    > |
    > | HelpLink:
    > |
    > |
    > | The line of code that is failing is this:
    > | System.Web.Mail.SmtpMail.Send(this.HomeOfficeEmail, oUser.Email,
    > |
    > | oEmailMessage.Subject, oEmailMessage.Body);
    > |
    > | I stepped through the code and all the values are correct so I can only
    > | assume that something is wrong with .NET itself.
    > |
    > | Any help would be appreciated!!!
    > |
    > | Andrea
    > |
    > |
    >
    >
     
    Andrea Williams, Dec 10, 2004
    #5
  6. Oh yes, I checked and the ASPNET account is set to never expireand the SMTP
    is set to allow anonymous...
    Andrea


    "bruce barker" <> wrote in message
    news:#e#...
    > the smtp server is rejecting the connection, or is not found. check that

    the
    > stmpp servername is valid, that is it running, allows anonymous access,

    and
    > relaying from your asp.net server.
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "Andrea Williams" <> wrote in message
    > news:...
    > | I have been using this code for a while now and I haven't changed this
    > code
    > | for at least a couple weeks... I do not suspect the code. The error

    I'm
    > | getting is the following:
    > |
    > | Message: Could not access 'CDO.Message' object.
    > |
    > | StackTrace: at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object
    > obj,
    > | String methodName, Object[] args)
    > | at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
    > | at System.Web.Mail.CdoSysHelper.Send(String from, String to, String
    > subject,
    > | String messageText)
    > | at System.Web.Mail.SmtpMail.Send(String from, String to, String subject,
    > | String messageText)
    > | at DSI.CIS.UserRegister.btnSubmit_Click(Object sender, EventArgs e) in
    > | c:\inetpub\wwwroot\DSI\CIS\UserRegister.aspx.cs:line 524
    > |
    > | TargetSite: System.Object CallMethod(System.Object, System.String,
    > | System.Object[])
    > |
    > | InnerException: System.Reflection.TargetInvocationException: Exception

    has
    > | been thrown by the target of an invocation. --->
    > | System.Runtime.InteropServices.COMException (0x80040213): The transport
    > | failed to connect to the server.
    > |
    > | --- End of inner exception stack trace ---
    > | at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
    > invokeAttr,
    > | Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
    > | String[] namedParameters)
    > | at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,


    > | Binder binder, Object target, Object[] args, ParameterModifier[]
    > modifiers,
    > | CultureInfo culture, String[] namedParameters)
    > | at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
    > | methodName, Object[] args)
    > |
    > | HelpLink:
    > |
    > |
    > | The line of code that is failing is this:
    > | System.Web.Mail.SmtpMail.Send(this.HomeOfficeEmail, oUser.Email,
    > |
    > | oEmailMessage.Subject, oEmailMessage.Body);
    > |
    > | I stepped through the code and all the values are correct so I can only
    > | assume that something is wrong with .NET itself.
    > |
    > | Any help would be appreciated!!!
    > |
    > | Andrea
    > |
    > |
    >
    >
     
    Andrea Williams, Dec 10, 2004
    #6
  7. New info!

    Going on the premise that the CDO.Message object was not firing based on
    some kind of permission, I looked for the dll for the object
    (cdosys.dll). I looked at the security tab on that dll and found that
    compared to other dll's, the "Users" group was not given permission to
    execute the dll. I added the permission and added the connection security
    back to SMTP that had made SMTP fail. Then I tested my email send again. It
    worked!

    So my question is, why did one of the patches take the security group off of
    the dll in the first place?

    Andrea


    "Andrea Williams" <> wrote in message
    news:...
    > I have been using this code for a while now and I haven't changed this

    code
    > for at least a couple weeks... I do not suspect the code. The error I'm
    > getting is the following:
    >
    > Message: Could not access 'CDO.Message' object.
    >
    > StackTrace: at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object

    obj,
    > String methodName, Object[] args)
    > at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
    > at System.Web.Mail.CdoSysHelper.Send(String from, String to, String

    subject,
    > String messageText)
    > at System.Web.Mail.SmtpMail.Send(String from, String to, String subject,
    > String messageText)
    > at DSI.CIS.UserRegister.btnSubmit_Click(Object sender, EventArgs e) in
    > c:\inetpub\wwwroot\DSI\CIS\UserRegister.aspx.cs:line 524
    >
    > TargetSite: System.Object CallMethod(System.Object, System.String,
    > System.Object[])
    >
    > InnerException: System.Reflection.TargetInvocationException: Exception has
    > been thrown by the target of an invocation. --->
    > System.Runtime.InteropServices.COMException (0x80040213): The transport
    > failed to connect to the server.
    >
    > --- End of inner exception stack trace ---
    > at System.RuntimeType.InvokeDispMethod(String name, BindingFlags

    invokeAttr,
    > Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
    > String[] namedParameters)
    > at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
    > Binder binder, Object target, Object[] args, ParameterModifier[]

    modifiers,
    > CultureInfo culture, String[] namedParameters)
    > at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
    > methodName, Object[] args)
    >
    > HelpLink:
    >
    >
    > The line of code that is failing is this:
    > System.Web.Mail.SmtpMail.Send(this.HomeOfficeEmail, oUser.Email,
    >
    > oEmailMessage.Subject, oEmailMessage.Body);
    >
    > I stepped through the code and all the values are correct so I can only
    > assume that something is wrong with .NET itself.
    >
    > Any help would be appreciated!!!
    >
    > Andrea
    >
    >
     
    Andrea Williams, Dec 13, 2004
    #7
  8. Ok, I was wrong... The last thing I did only made it worked if the user was
    NOT logged in to my app. I'm using Form Authenitication with my database
    info and once I'm logged into my app, the email will no longer send... same
    error as before.

    I added the Everyone permission to the cdosys.dll and that didn't fix it, so
    now I'm stumped.

    Andrea


    "Andrea Williams" <> wrote in message
    news:...
    > I have been using this code for a while now and I haven't changed this

    code
    > for at least a couple weeks... I do not suspect the code. The error I'm
    > getting is the following:
    >
    > Message: Could not access 'CDO.Message' object.
    >
    > StackTrace: at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object

    obj,
    > String methodName, Object[] args)
    > at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
    > at System.Web.Mail.CdoSysHelper.Send(String from, String to, String

    subject,
    > String messageText)
    > at System.Web.Mail.SmtpMail.Send(String from, String to, String subject,
    > String messageText)
    > at DSI.CIS.UserRegister.btnSubmit_Click(Object sender, EventArgs e) in
    > c:\inetpub\wwwroot\DSI\CIS\UserRegister.aspx.cs:line 524
    >
    > TargetSite: System.Object CallMethod(System.Object, System.String,
    > System.Object[])
    >
    > InnerException: System.Reflection.TargetInvocationException: Exception has
    > been thrown by the target of an invocation. --->
    > System.Runtime.InteropServices.COMException (0x80040213): The transport
    > failed to connect to the server.
    >
    > --- End of inner exception stack trace ---
    > at System.RuntimeType.InvokeDispMethod(String name, BindingFlags

    invokeAttr,
    > Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
    > String[] namedParameters)
    > at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
    > Binder binder, Object target, Object[] args, ParameterModifier[]

    modifiers,
    > CultureInfo culture, String[] namedParameters)
    > at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
    > methodName, Object[] args)
    >
    > HelpLink:
    >
    >
    > The line of code that is failing is this:
    > System.Web.Mail.SmtpMail.Send(this.HomeOfficeEmail, oUser.Email,
    >
    > oEmailMessage.Subject, oEmailMessage.Body);
    >
    > I stepped through the code and all the values are correct so I can only
    > assume that something is wrong with .NET itself.
    >
    > Any help would be appreciated!!!
    >
    > Andrea
    >
    >
     
    Andrea Williams, Dec 13, 2004
    #8
    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. jim

    Sendmail problem

    jim, Oct 24, 2003, in forum: Perl
    Replies:
    4
    Views:
    686
  2. Sachin Jagtap

    URGENT !! QUEUE STL PROBLEM URGENT!!

    Sachin Jagtap, Apr 28, 2005, in forum: C++
    Replies:
    4
    Views:
    1,064
    Mark Stijnman
    Apr 29, 2005
  3. sugapablo
    Replies:
    0
    Views:
    2,212
    sugapablo
    Sep 21, 2007
  4. Andrzej Adam Filip
    Replies:
    0
    Views:
    4,210
    Andrzej Adam Filip
    Mar 31, 2008
  5. Rob
    Replies:
    3
    Views:
    458
Loading...

Share This Page