By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,117 Members | 2,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,117 IT Pros & Developers. It's quick & easy.

"Could not access 'CDO.Message' object" when sending attachments

P: n/a
Here's the exception:

System.Exception: Unable to send mail: Could not access 'CDO.Message'
object. ---> System.Web.HttpException: Could not access 'CDO.Message'
object. ---> System.Reflection.TargetInvocationException: Exception
has been thrown by the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x80004005): Unspecified
error

--- 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)
--- End of inner exception stack trace ---
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.SmtpMail.Send(MailMessage message)
at MyApp.MyApp.Util.SendEmail(MailMessage& objMail)
--- End of inner exception stack trace ---
at MyApp.MyApp.Util.SendEmail(MailMessage& objMail)
at MyApp.MI.btnServerSave_Click(Object sender, EventArgs e)
--------
We've tried all the suggestions at http://www.systemwebmail.com/, to
no avail. Nevertheless it still seems to be permissions-related,
because we temporarily resolved it by adding all my users to the local
Administrators group. Any ideas?
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
The "Unspecified Error" is a real pain in the neck, and can mean any number
of things. Most commonly, it's a Relaying configuration issue with the SMTP
server.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Liz Patton" <mo******@hotmail.com> wrote in message
news:40**************************@posting.google.c om...
Here's the exception:

System.Exception: Unable to send mail: Could not access 'CDO.Message'
object. ---> System.Web.HttpException: Could not access 'CDO.Message'
object. ---> System.Reflection.TargetInvocationException: Exception
has been thrown by the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x80004005): Unspecified
error

--- 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)
--- End of inner exception stack trace ---
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.SmtpMail.Send(MailMessage message)
at MyApp.MyApp.Util.SendEmail(MailMessage& objMail)
--- End of inner exception stack trace ---
at MyApp.MyApp.Util.SendEmail(MailMessage& objMail)
at MyApp.MI.btnServerSave_Click(Object sender, EventArgs e)
--------
We've tried all the suggestions at http://www.systemwebmail.com/, to
no avail. Nevertheless it still seems to be permissions-related,
because we temporarily resolved it by adding all my users to the local
Administrators group. Any ideas?

Nov 18 '05 #2

P: n/a
As Kevin mentioned, the SMTP server relay config is usually the case, but
there are a couple more. Have a look at http://www.systemwebmail.com for a
lot of tips and answers.

--
- Paul Glavich
Microsoft MVP - ASP.NET
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
The "Unspecified Error" is a real pain in the neck, and can mean any number of things. Most commonly, it's a Relaying configuration issue with the SMTP server.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Liz Patton" <mo******@hotmail.com> wrote in message
news:40**************************@posting.google.c om...
Here's the exception:

System.Exception: Unable to send mail: Could not access 'CDO.Message'
object. ---> System.Web.HttpException: Could not access 'CDO.Message'
object. ---> System.Reflection.TargetInvocationException: Exception
has been thrown by the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x80004005): Unspecified
error

--- 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)
--- End of inner exception stack trace ---
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.SmtpMail.Send(MailMessage message)
at MyApp.MyApp.Util.SendEmail(MailMessage& objMail)
--- End of inner exception stack trace ---
at MyApp.MyApp.Util.SendEmail(MailMessage& objMail)
at MyApp.MI.btnServerSave_Click(Object sender, EventArgs e)
--------
We've tried all the suggestions at http://www.systemwebmail.com/, to
no avail. Nevertheless it still seems to be permissions-related,
because we temporarily resolved it by adding all my users to the local
Administrators group. Any ideas?


Nov 18 '05 #3

P: n/a
I ran into this issue with a project some time ago and came to the same conclusion, that it was permissions related. The solution to the problem ended up being to use a third party SMTP component. We ended up going with IPWorks for .Net, which has been solid, no problems with it. IPWorks is great if you have the budget for it, otherwise, I know there's at least one free SMTP component out there, OpenSMTP, which can be found on SourceForge. At the time, I tried using OpenSMTP, but had problems with it. If I recall correctly, these problems were related to using framework 1.0. Upgrading to 1.1 at the time wasn't an option so I never bothered to see if that would have solved the errors.

Good luck!

Cletus
"Liz Patton" wrote:
Here's the exception:

System.Exception: Unable to send mail: Could not access 'CDO.Message'
object. ---> System.Web.HttpException: Could not access 'CDO.Message'
object. ---> System.Reflection.TargetInvocationException: Exception
has been thrown by the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x80004005): Unspecified
error

--- 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)
--- End of inner exception stack trace ---
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.SmtpMail.Send(MailMessage message)
at MyApp.MyApp.Util.SendEmail(MailMessage& objMail)
--- End of inner exception stack trace ---
at MyApp.MyApp.Util.SendEmail(MailMessage& objMail)
at MyApp.MI.btnServerSave_Click(Object sender, EventArgs e)
--------
We've tried all the suggestions at http://www.systemwebmail.com/, to
no avail. Nevertheless it still seems to be permissions-related,
because we temporarily resolved it by adding all my users to the local
Administrators group. Any ideas?

Nov 18 '05 #4

P: n/a
Figured it out -- it had to do with impersonation. Here's the setup:
ASP.Net web application using local SMTP mail service to send emails,
some with attachments, some without attachments. Web app set to use
Windows integrated security with impersonation, so web.config has
these entries:

<authentication mode="Windows" />
<identity impersonate="true" />

All worked fine until we went to the email attachments. Either the
"unspecified error" exception was thrown, or on other servers the
email was sent but the attachments were corrupted. GIFs, TIFs, PDFs,
you name it. Turns out that when handling email attachments, CDO does
not entirely assume the impersonation identity. Instead, the
aspnet_wp.exe process identity defined in machine.config comes into
play, same as it would if you were using anonymous access. This
process needs to create its own temp directory, found on my machine
under c:\Documents and Settings\<machinename>\ASPNET\Local Settings.
(When I initially went hunting for temp directories all over the drive
I didn't find it because it wasn't there yet!) Then, when sending out
the email, the authenticated users were getting "access denied" when
their identity tried to look into the ASPNET documents tree for
attachment info. So we granted permissions on that dir to my
MYDOMAIN\myusergroup, and the problem went away.

Useful background found in Microsoft KB # 317012 Process and request
identity in ASP.NET:

http://support.microsoft.com/default...b;en-us;317012

P.S. -- A plea to Microsoft: Write better error messages! These
permissions problems wouldn't be so horrendously difficult to figure
out if we had something to go on other than "Unspecified error."
Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.