I would strongly recommend you don't use the built-in MailMessage and
SmtpMail stuff in .NET
They're very simplistic wrappers (as you might suspect) for some calls to
the CDO COM components. The implementation is pretty poor in a number of
respects and you have very little control. It also has some installation
pre-requisites that aren't documented in the .NET documentation.
I would highly recommend you find a separate SMTP library, either one of the
open source implementations or one of the commercial libraries.
Pete
"Patrick de Ridder" <wa********@all.here> wrote in message
news:6c**************************@freeler.nl...
MailMessage myMail = new MailMessage();
myMail.From = textFrom.Text.Trim();
myMail.To = textTo.Text.Trim();
myMail.Subject = textSubject.Text.Trim();
myMail.BodyFormat = MailFormat.Text;
myMail.Body = textMsg.Text.Trim();
SmtpMail.SmtpServer = textSMTPServer.Text.Trim();
SmtpMail.Send(myMail);
*********************************
The above code produces this error:
Cannot access 'CDO.Message' object.
What is wrong?
Patrick.