D
dorisferrarese
I am running into the wonderful expection:
"Could not access 'CDO.Message' object."
"Exception has been thrown by the target of an invocation."
You can checkout my code below -
The interesting part with my error is that it only occurs with:
myMessage.BodyFormat = System.Web.Mail.MailFormat.Html;
The email relays perfectly fine with:
myMessage.BodyFormat = System.Web.Mail.MailFormat.Text;
I have spent 1.5 days on this so far ..
~ Doris.
----------------------------------------------------------------------------------------
This is my code:
try
{
MailMessage myMessage = new MailMessage();
myMessage.From = "(e-mail address removed)";
myMessage.To = "(e-mail address removed)";
SmtpMail.SmtpServer = "";
myMessage.BodyFormat = System.Web.Mail.MailFormat.Html;
myMessage.Body = "<html><head></head><body>Hello Andrei</
body></html>";
//myMessage.BodyFormat = System.Web.Mail.MailFormat.Text;
//myMessage.Body = "test";
SmtpMail.Send(myMessage);
}
catch(Exception ex)
{
throw new Exception(strMessage);
}
"Could not access 'CDO.Message' object."
"Exception has been thrown by the target of an invocation."
You can checkout my code below -
The interesting part with my error is that it only occurs with:
myMessage.BodyFormat = System.Web.Mail.MailFormat.Html;
The email relays perfectly fine with:
myMessage.BodyFormat = System.Web.Mail.MailFormat.Text;
I have spent 1.5 days on this so far ..
~ Doris.
----------------------------------------------------------------------------------------
This is my code:
try
{
MailMessage myMessage = new MailMessage();
myMessage.From = "(e-mail address removed)";
myMessage.To = "(e-mail address removed)";
SmtpMail.SmtpServer = "";
myMessage.BodyFormat = System.Web.Mail.MailFormat.Html;
myMessage.Body = "<html><head></head><body>Hello Andrei</
body></html>";
//myMessage.BodyFormat = System.Web.Mail.MailFormat.Text;
//myMessage.Body = "test";
SmtpMail.Send(myMessage);
}
catch(Exception ex)
{
throw new Exception(strMessage);
}