472,371 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 software developers and data experts.

send email with VB.NET and exchange

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.
Jul 19 '05 #1
8 18423
"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?


Look at all of the messages in the exception stack, "Could not access
'CDO.Message' object" is the message in the first exception. That exception
also has an InnerException property which probably references another
exception etc, etc. Keep going until InnerException is null. When you see
all of the messages you'll have a better idea of what's going wrong.

You can also use the ToString() method on an exception and it will build a
string that contains all of the messages.

Jul 19 '05 #2
I tried what you suggested. Doesn't work. I don't get an error message
however. No error message, the code is executed and nothing happens.

here is the code:

Dim iMsg As New CDO.Message()

iMsg.From = "st**********@bonlalum.com"
iMsg.To = "st**********@bonlalum.com"
iMsg.HTMLBody = "samia"
iMsg.Send()

any other ideas???

Thanks

Samia.
"Darshan Mehta" <ob*****@hotmail.com> wrote in message news:<04****************************@phx.gbl>...
The following information was taken off the microsoft
website:

To begin building a new message, first create an instance
of the Message COM class, as shown in the following
example:

[Visual Basic]
'Reference to Microsoft ActiveX Data Objects 2.5 Library
'Reference to Microsoft CDO for Windows 2000 Library
Dim iMsg As New CDO.Message

You can create and send or post a simple message using
only the IMessage interface. To send a Simple Mail
Transfer Protocol (SMTP) message, you must at least set
the To, From and Subject properties on the IMessage
interface. To post a Network News Transfer Protocol
(NNTP) message, you must at least set the
IMessage.Newsgroups and IMessage.Subject properties.

To send a message call the IMessage.Send (SMTP) or
IMessage.Post (NNTP) method

Hope this helps,
Darshan

Jul 19 '05 #3
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.

Jul 21 '05 #4
"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?


Look at all of the messages in the exception stack, "Could not access
'CDO.Message' object" is the message in the first exception. That exception
also has an InnerException property which probably references another
exception etc, etc. Keep going until InnerException is null. When you see
all of the messages you'll have a better idea of what's going wrong.

You can also use the ToString() method on an exception and it will build a
string that contains all of the messages.

Nov 22 '05 #5
"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?


Look at all of the messages in the exception stack, "Could not access
'CDO.Message' object" is the message in the first exception. That exception
also has an InnerException property which probably references another
exception etc, etc. Keep going until InnerException is null. When you see
all of the messages you'll have a better idea of what's going wrong.

You can also use the ToString() method on an exception and it will build a
string that contains all of the messages.

Nov 22 '05 #6
I tried what you suggested. Doesn't work. I don't get an error message
however. No error message, the code is executed and nothing happens.

here is the code:

Dim iMsg As New CDO.Message()

iMsg.From = "st**********@bonlalum.com"
iMsg.To = "st**********@bonlalum.com"
iMsg.HTMLBody = "samia"
iMsg.Send()

any other ideas???

Thanks

Samia.
"Darshan Mehta" <ob*****@hotmail.com> wrote in message news:<04****************************@phx.gbl>...
The following information was taken off the microsoft
website:

To begin building a new message, first create an instance
of the Message COM class, as shown in the following
example:

[Visual Basic]
'Reference to Microsoft ActiveX Data Objects 2.5 Library
'Reference to Microsoft CDO for Windows 2000 Library
Dim iMsg As New CDO.Message

You can create and send or post a simple message using
only the IMessage interface. To send a Simple Mail
Transfer Protocol (SMTP) message, you must at least set
the To, From and Subject properties on the IMessage
interface. To post a Network News Transfer Protocol
(NNTP) message, you must at least set the
IMessage.Newsgroups and IMessage.Subject properties.

To send a message call the IMessage.Send (SMTP) or
IMessage.Post (NNTP) method

Hope this helps,
Darshan

Nov 22 '05 #7
I tried what you suggested. Doesn't work. I don't get an error message
however. No error message, the code is executed and nothing happens.

here is the code:

Dim iMsg As New CDO.Message()

iMsg.From = "st**********@bonlalum.com"
iMsg.To = "st**********@bonlalum.com"
iMsg.HTMLBody = "samia"
iMsg.Send()

any other ideas???

Thanks

Samia.
"Darshan Mehta" <ob*****@hotmail.com> wrote in message news:<04****************************@phx.gbl>...
The following information was taken off the microsoft
website:

To begin building a new message, first create an instance
of the Message COM class, as shown in the following
example:

[Visual Basic]
'Reference to Microsoft ActiveX Data Objects 2.5 Library
'Reference to Microsoft CDO for Windows 2000 Library
Dim iMsg As New CDO.Message

You can create and send or post a simple message using
only the IMessage interface. To send a Simple Mail
Transfer Protocol (SMTP) message, you must at least set
the To, From and Subject properties on the IMessage
interface. To post a Network News Transfer Protocol
(NNTP) message, you must at least set the
IMessage.Newsgroups and IMessage.Subject properties.

To send a message call the IMessage.Send (SMTP) or
IMessage.Post (NNTP) method

Hope this helps,
Darshan

Nov 22 '05 #8
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.

Nov 22 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to...
3
by: icsupt via AccessMonster.com | last post by:
I would like to send an email from Access. I copied the code from another free website, but it does not do everything I need it to do. I have a series of checkboxes: checkbox1 - when checked,...
0
by: Just D. | last post by:
All, Is there a simple way to send a plain email message via MS Exchange server? I know that it's pretty easy to send a message via SMTP using a standard ..NET library, but what about M$...
9
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
3
by: Mike B | last post by:
Ok anybody got any good ideas on how to send a fax from ASP.NET. I have an exchange server available with a ms faxserver running both on a different machine to the web server. Mike
1
by: michi | last post by:
Hi there.... Got here a tricky thing with my SMTP. First I show you what works on my machine.. **This Works** SmtpMail.SmtpServer = "mail.gmx.net" <-gmx is my mail provider...
6
by: JIM.H. | last post by:
Hello, I am using SmtpMail.Send() and I get the following message The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for myMail@hotmail.com...
9
by: Paul H | last post by:
If there is no email client on the XP workstation that my DB is on, is it possible for Access to talk directly with Exchange Server to send an email? I am sure you might think, what's the problem...
17
by: rdemyan | last post by:
My app creates a building report. My users have requested that I provide functionality to e-mail these "building reports" to building managers once a month. So assuming that I have the...
2
by: xx75vulcan | last post by:
Howdy, I have successfully setup my php.ini file on a web server to communicate with my Microsoft Exchange Mail server, and can test the ability to send mail using the mail() function to...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.