Samia,
I have the same problem, only doing this from an ASP.Net website. The only
reason I could find for this was the installation of Office XP, which
replaces the reference to the CDO dll on Windows with a newer version (which
in my mind might be the only problem). I haven't found anything to verify my
thoughts, though.
As for the other suggested solution, I've used it, and it works fine. You
have to set the SMTP server on the Configuration of the e-mail message
object:
Dim iMsg As New CDO.Message()
iMsg.From = "st**********@bonlalum.com"
iMsg.To = "st**********@bonlalum.com"
iMsg.HTMLBody = "samia"
iMsg.Configuration.Fields["http://schemas.microsoft.com/cdo/configuration/se
ndusing"].Value = 2;
iMsg.Configuration.Fields["http://schemas.microsoft.com/cdo/configuration/sm
tpserverport"].Value = 25;
iMsg.Configuration.Fields["http://schemas.microsoft.com/cdo/configuration/sm
tpserver"].Value = strMailServer;
iMsg.Configuration.Fields.Update();
iMsg.Send()
Hope this helps
Thys Brits
MCSD/MCAD
"Samia" <sa*************@hotmail.com> wrote in message
news:1d**************************@posting.google.c om...
I have an application running on a single workstation (win 2000) with
Outlook installed and a profile create using and exchange server with
authentification through the DNS. This user profile is the only one
using the app.
I want the app to send email using the profile's email adress.
Here is what I am doing :
Dim mail As New MailMessage()
mail.From = "my*******@mydomain.com"
mail.To = "an************@mydomain.com"
mail.Subject = "test msg"
mail.Body = "blablabla"
mail.BodyFormat = MailFormat.Html
SmtpMail.SmtpServer = "mydomain.com"
SmtpMail.Send(mail)
The problem is that I get the error message
An unhandled exception of type 'System.Web.HttpException' occurred in
system.web.dll
Additional information: Could not access 'CDO.Message' object.
I tried changing smtpserver to myexchangeserver.mydomain.com and I get
the same error message.
Any ideas?
Samia.