Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Urgent SendMail Problem (http://www.velocityreviews.com/forums/t92476-urgent-sendmail-problem.html)

Andrea Williams 12-09-2004 05:39 PM

Urgent SendMail Problem
 
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(O bject 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:li ne 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(O bject 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] 12-09-2004 08:57 PM

Re: Urgent SendMail Problem
 
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" <andreawil@hotmailIHATESPAM.com> wrote in message
news:epRjMYh3EHA.1408@TK2MSFTNGP10.phx.gbl...
>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(O bject
> 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:li ne 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(O bject 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 12-09-2004 09:25 PM

Re: Urgent SendMail Problem
 
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" <andreawil@hotmailIHATESPAM.com> wrote in message
news:epRjMYh3EHA.1408@TK2MSFTNGP10.phx.gbl...
| 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(O bject
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:li ne 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(O bject 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 12-10-2004 04:02 PM

Re: Urgent SendMail Problem
 
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]" <BANSPAMken_cox@sympatico.ca> wrote in message
news:OWNVxGj3EHA.1396@tk2msftngp13.phx.gbl...
> 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" <andreawil@hotmailIHATESPAM.com> wrote in message
> news:epRjMYh3EHA.1408@TK2MSFTNGP10.phx.gbl...
> >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(O bject
> > 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:li ne 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(O bject 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 12-10-2004 04:10 PM

Re: Urgent SendMail Problem
 
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" <nospam_brubar@safeco.com> wrote in message
news:#e#NrWj3EHA.1564@TK2MSFTNGP09.phx.gbl...
> 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" <andreawil@hotmailIHATESPAM.com> wrote in message
> news:epRjMYh3EHA.1408@TK2MSFTNGP10.phx.gbl...
> | 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(O bject
> 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:li ne 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(O bject 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 12-10-2004 04:14 PM

Re: Urgent SendMail Problem
 
Oh yes, I checked and the ASPNET account is set to never expireand the SMTP
is set to allow anonymous...
Andrea


"bruce barker" <nospam_brubar@safeco.com> wrote in message
news:#e#NrWj3EHA.1564@TK2MSFTNGP09.phx.gbl...
> 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" <andreawil@hotmailIHATESPAM.com> wrote in message
> news:epRjMYh3EHA.1408@TK2MSFTNGP10.phx.gbl...
> | 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(O bject
> 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:li ne 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(O bject 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 12-13-2004 05:40 PM

Re: Urgent SendMail Problem
 
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" <andreawil@hotmailIHATESPAM.com> wrote in message
news:epRjMYh3EHA.1408@TK2MSFTNGP10.phx.gbl...
> 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(O bject

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:li ne 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(O bject 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 12-13-2004 06:05 PM

Re: Urgent SendMail Problem
 
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" <andreawil@hotmailIHATESPAM.com> wrote in message
news:epRjMYh3EHA.1408@TK2MSFTNGP10.phx.gbl...
> 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(O bject

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:li ne 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(O bject 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
>
>





All times are GMT. The time now is 01:39 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.