C
ChrisA
I'm sending email from my ASP.NET 1.1 app, and it works fine providing the
BodyFormat of the System.Web.Mail.MailMessage is set to Text.
If I change to Html format, it breaks. Here's the code:
Me.Msg = New System.Web.Mail.MailMessage
With Me.Msg
.To = "someToAddress"
.From = "someFromAddress"
.Subject = "subject"
.BodyFormat = Mail.MailFormat.Html
.Body = someTextString
.Priority = MailPriority.Normal
End With
SmtpMail.SmtpServer = "mySmtpServer"
SmtpMail.Send(Me.Msg)
This works fine if the format is Mail.MailFormat.Text, but not Html.
Would greatly appreciate any clues as to cause and cure..
The exception (and inner exception) I get is as follows:
Could not access 'CDO.Message' object.
at System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String
propName, Object propValue)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.SmtpMail.Send(MailMessage message)
at InTouchWeb.EmailSender.SendEmail() in
c:\inetpub\wwwroot\InTouchWeb\EmailSender.vb:line 36
--------------------------------
Exception has been thrown by the target of an invocation.
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.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder
binder, Object target, Object[] args)
at System.Web.Mail.LateBoundAccessHelper.SetProp(Type type, Object obj,
String propName, Object propValue)
at System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String
propName, Object propValue)
BodyFormat of the System.Web.Mail.MailMessage is set to Text.
If I change to Html format, it breaks. Here's the code:
Me.Msg = New System.Web.Mail.MailMessage
With Me.Msg
.To = "someToAddress"
.From = "someFromAddress"
.Subject = "subject"
.BodyFormat = Mail.MailFormat.Html
.Body = someTextString
.Priority = MailPriority.Normal
End With
SmtpMail.SmtpServer = "mySmtpServer"
SmtpMail.Send(Me.Msg)
This works fine if the format is Mail.MailFormat.Text, but not Html.
Would greatly appreciate any clues as to cause and cure..
The exception (and inner exception) I get is as follows:
Could not access 'CDO.Message' object.
at System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String
propName, Object propValue)
at System.Web.Mail.CdoSysHelper.Send(MailMessage message)
at System.Web.Mail.SmtpMail.Send(MailMessage message)
at InTouchWeb.EmailSender.SendEmail() in
c:\inetpub\wwwroot\InTouchWeb\EmailSender.vb:line 36
--------------------------------
Exception has been thrown by the target of an invocation.
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.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder
binder, Object target, Object[] args)
at System.Web.Mail.LateBoundAccessHelper.SetProp(Type type, Object obj,
String propName, Object propValue)
at System.Web.Mail.LateBoundAccessHelper.SetProp(Object obj, String
propName, Object propValue)