R
Ray Booysen
Hi all
I'm sending email via ASP.NET in HTML mode. Each email has exactly one
attachment and I do have full access to the SMTP server. However, if I
send the email in HTML format, the framework reports the following
exception:
"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 (0x80040605): Unknown
Error\r\n --- End of inner exception stack trace ---\r\n at
System.RuntimeType.InvokeDispMethod(String name, BindingFlags
invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers,
Int32 culture, String[] namedParameters)\r\n at
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifier[]
modifiers, CultureInfo culture, String[] namedParameters)\r\n at
System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder
binder, Object target, Object[] args)\r\n at
System.Web.Mail.LateBoundAccessHelper.SetProp(Type type, Object obj,
String propName, Object propValue)\r\n at
System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String
propName, Object propValue)\r\n --- E
nd of inner exception stack trace ---\r\n at
System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String
propName, Object propValue)\r\n at
System.Web.Mail.CdoSysHelper.Send(MailMessage message)\r\n at
System.Web.Mail.SmtpMail.Send(MailMessage message)\r\n at
XYZ.Utils.SendEmail(MailMessage Message, String SMTPServer) in
c:\\inetpub\\wwwroot\\XYZ\\utils.cs:line 406\r\n at
XYZ.Utils.SendEmail(String From, String To, String Bcc, String Cc,
String Subject, String Body, String[] Attachments, MailFormat Format,
String SMTPServer) in c:\\inetpub\\wwwroot\\XYZ\\utils.cs:line 392\r\n
at XYZ.Utils.SendEmail(String From, String To, String Bcc, String Cc,
String Subject, String Body, String[] Attachments, MailFormat Format) in
c:\\inetpub\\wwwroot\\XYZ\\utils.cs:line 396\r\n at
XYZ.Email.butSend_Click(Object sender, EventArgs e) in
c:\\inetpub\\wwwroot\\XYZ\\email.aspx.cs:line 178"
However, sending in plain text works perfectly.
Any ideas?
Regards
Ray
I'm sending email via ASP.NET in HTML mode. Each email has exactly one
attachment and I do have full access to the SMTP server. However, if I
send the email in HTML format, the framework reports the following
exception:
"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 (0x80040605): Unknown
Error\r\n --- End of inner exception stack trace ---\r\n at
System.RuntimeType.InvokeDispMethod(String name, BindingFlags
invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers,
Int32 culture, String[] namedParameters)\r\n at
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifier[]
modifiers, CultureInfo culture, String[] namedParameters)\r\n at
System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder
binder, Object target, Object[] args)\r\n at
System.Web.Mail.LateBoundAccessHelper.SetProp(Type type, Object obj,
String propName, Object propValue)\r\n at
System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String
propName, Object propValue)\r\n --- E
nd of inner exception stack trace ---\r\n at
System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String
propName, Object propValue)\r\n at
System.Web.Mail.CdoSysHelper.Send(MailMessage message)\r\n at
System.Web.Mail.SmtpMail.Send(MailMessage message)\r\n at
XYZ.Utils.SendEmail(MailMessage Message, String SMTPServer) in
c:\\inetpub\\wwwroot\\XYZ\\utils.cs:line 406\r\n at
XYZ.Utils.SendEmail(String From, String To, String Bcc, String Cc,
String Subject, String Body, String[] Attachments, MailFormat Format,
String SMTPServer) in c:\\inetpub\\wwwroot\\XYZ\\utils.cs:line 392\r\n
at XYZ.Utils.SendEmail(String From, String To, String Bcc, String Cc,
String Subject, String Body, String[] Attachments, MailFormat Format) in
c:\\inetpub\\wwwroot\\XYZ\\utils.cs:line 396\r\n at
XYZ.Email.butSend_Click(Object sender, EventArgs e) in
c:\\inetpub\\wwwroot\\XYZ\\email.aspx.cs:line 178"
However, sending in plain text works perfectly.
Any ideas?
Regards
Ray