SMTP question

P

Patrick de Ridder

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.
 
P

Patrick de Ridder

Well, I see that the error cause possibilities are rather nemerous :(
Use a different dll?
Patrick.
 
G

Guest

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
 
P

Patrick de Ridder

Hi Pete,

Right! I have downloaded QuikSoft and it works aok.
Both the indy dll and the Windows dll caused problems.

The Quiksoft library is free and must not be re-sold.
Could you recommend a commerical SMTP library to me?

Many thanks,
Patrick.
(e-mail address removed)
 
G

Guest

I actually haven't used any commercial ones, so I'd hesitate to recommend
any of them. Perhaps someone here has some experience and can help you out
there. I've only used the SMTP stuff for personal projects and have used
open source alternatives.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Email out of C# 1
Email Client 1
System.web.mail 2
System.Net.Mail.SmtpClient is slower 1
mail attachment program in c# 1
sending an email 1
Send Mail Problem 3
Update VB6 to VB.NET 2.0 Email Send 2

Top