Hi,
I've written a small proof of concept application to show we can send emails
in VB.NET and it works a treat using this piece of code:

Dim myEmail As System.Web.Mail.MailMessage = New
System.Web.Mail.MailMessage()
myEmail.From = txtFrom.Text
myEmail.To = txtTo.Text
myEmail.Body = txtBody.Text
SmtpMail.SmtpServer = ""
SmtpMail.Send(myEmail)

But if I specify a mailserver in SmtpMail.SmtpServer I get this error:
Could not access 'CDO.Message' object.

Why does setting SmtpMail.SmtpServer = "" send the email?

Does this mean that using System.Web.Mail.MailMessage is reliant on having
Outlook or Outlook Express installed (Currently I have Outlook 2003
installed)?

Thanks
Darren

Re: Using System.Web.Mail.MailMessage in Windows Forms by Darren

Darren
Thu Apr 06 06:48:29 CDT 2006

I've answered my own question too "Why does setting SmtpMail.SmtpServer = ""
send the email?"
It was using Default SMTP virtual server within IIS then sending to our mail
servers and I'm guessing the mail servers validated my PC and allowed the
email to be sent.

But will still like to know the rest of my question's

Thanks in advance

"Darren Gulliver" <darren.gulliver@thomson.com> wrote in message
news:OjIuM1WWGHA.1900@TK2MSFTNGP04.phx.gbl...
> Hi,
> I've written a small proof of concept application to show we can send
> emails in VB.NET and it works a treat using this piece of code:
>
> Dim myEmail As System.Web.Mail.MailMessage = New
> System.Web.Mail.MailMessage()
> myEmail.From = txtFrom.Text
> myEmail.To = txtTo.Text
> myEmail.Body = txtBody.Text
> SmtpMail.SmtpServer = ""
> SmtpMail.Send(myEmail)
>
> But if I specify a mailserver in SmtpMail.SmtpServer I get this error:
> Could not access 'CDO.Message' object.
>
> Why does setting SmtpMail.SmtpServer = "" send the email?
>
> Does this mean that using System.Web.Mail.MailMessage is reliant on having
> Outlook or Outlook Express installed (Currently I have Outlook 2003
> installed)?
>
> Thanks
> Darren
>



Re: Using System.Web.Mail.MailMessage in Windows Forms by Herfried

Herfried
Thu Apr 06 09:43:32 CDT 2006

"Darren Gulliver" <darren.gulliver@thomson.com> schrieb:
> I've written a small proof of concept application to show we can send
> emails in VB.NET and it works a treat using this piece of code:
>
> Dim myEmail As System.Web.Mail.MailMessage = New
> System.Web.Mail.MailMessage()
> myEmail.From = txtFrom.Text
> myEmail.To = txtTo.Text
> myEmail.Body = txtBody.Text
> SmtpMail.SmtpServer = ""
> SmtpMail.Send(myEmail)
>
> But if I specify a mailserver in SmtpMail.SmtpServer I get this error:
> Could not access 'CDO.Message' object.

=> <URL:http://www.systemwebmail.net/>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>