473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
4 3948
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ag | last post by:
Hi guys.. need your help. We have abc.asp page on the source server which calls a .net component on that server. The component is in MTS running under say "domain2\id1" identity. The component...
11
by: Florian Loitsch | last post by:
I'm currently writing a JS->Scheme compiler (which, using Bigloo, automatically yields a JS->C, JS->JVM, JS->.NET compiler), and have a question concerning the function-parameters: According to...
1
by: Uttam | last post by:
Hello, How does one suppress the "Object already exists" message when the following statement is executed in ADO? cat.Views.Append "Some_Query", cmd Thanks in advance. Uttam
3
by: Steve Lutz | last post by:
Hi All, I have a Windows Service that runs well. The service hosts a remote object. The purpose of the object is so that I can "peak" into the service to see what it's doing. I wrote a small...
1
by: Jens Øster | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
1
by: Pat | last post by:
I received this message when loading a web form that was working before. I rebuilt the project, but still could not get past this error. So, I basically copied the FILENAME.aspx.vb code and...
5
by: Christian Hvid | last post by:
What is the easiest way to get the "row object" or "item object" when a datagrid is clicked? I have web form with a datagrid. And I have an array of something called BlogEntry that I bind to the...
2
by: CWogksch | last post by:
Hello, Everyone... My name is Chris Wogksch. I have a point of sale application developed in VB6 using MS Access 2003 as the database. I've been running versions of this app for over eight...
0
by: CWogksch | last post by:
Hello, Everyone... My name is Chris Wogksch. I have a point of sale application developed in VB6 using MS Access 2003 as the database. I've been running versions of this app for over eight...
2
by: sbasavar | last post by:
Hi All, In my excel programming, I am using XML http object (MSXML2.XMLHTTP.3.0). Using this object when I try to send a request application throws an "Access is Denied" error. Strange thing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.