473,692 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
authentificatio n 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*******@mydo main.com"
mail.To = "an************ @mydomain.com"
mail.Subject = "test msg"
mail.Body = "blablabla"
mail.BodyFormat = MailFormat.Html
SmtpMail.SmtpSe rver = "mydomain.c om"
SmtpMail.Send(m ail)

The problem is that I get the error message
An unhandled exception of type 'System.Web.Htt pException' occurred in
system.web.dll
Additional information: Could not access 'CDO.Message' object.

I tried changing smtpserver to myexchangeserve r.mydomain.com and I get
the same error message.

Any ideas?

Samia.
Jul 19 '05 #1
8 18523
"Samia" <sa************ *@hotmail.com> wrote in message
news:1d******** *************** ***@posting.goo gle.com...
I have an application running on a single workstation (win 2000) with
Outlook installed and a profile create using and exchange server with
authentificatio n 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*******@mydo main.com"
mail.To = "an************ @mydomain.com"
mail.Subject = "test msg"
mail.Body = "blablabla"
mail.BodyFormat = MailFormat.Html
SmtpMail.SmtpSe rver = "mydomain.c om"
SmtpMail.Send(m ail)

The problem is that I get the error message
An unhandled exception of type 'System.Web.Htt pException' occurred in
system.web.dll
Additional information: Could not access 'CDO.Message' object.

I tried changing smtpserver to myexchangeserve r.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**********@b onlalum.com"
iMsg.To = "st**********@b onlalum.com"
iMsg.HTMLBody = "samia"
iMsg.Send()

any other ideas???

Thanks

Samia.
"Darshan Mehta" <ob*****@hotmai l.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.Newsgr oups and IMessage.Subjec t 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**********@b onlalum.com"
iMsg.To = "st**********@b onlalum.com"
iMsg.HTMLBody = "samia"

iMsg.Configurat ion.Fields["http://schemas.microso ft.com/cdo/configuration/se
ndusing"].Value = 2;

iMsg.Configurat ion.Fields["http://schemas.microso ft.com/cdo/configuration/sm
tpserverport"].Value = 25;

iMsg.Configurat ion.Fields["http://schemas.microso ft.com/cdo/configuration/sm
tpserver"].Value = strMailServer;
iMsg.Configurat ion.Fields.Upda te();

iMsg.Send()

Hope this helps

Thys Brits
MCSD/MCAD

"Samia" <sa************ *@hotmail.com> wrote in message
news:1d******** *************** ***@posting.goo gle.com...
I have an application running on a single workstation (win 2000) with
Outlook installed and a profile create using and exchange server with
authentificatio n 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*******@mydo main.com"
mail.To = "an************ @mydomain.com"
mail.Subject = "test msg"
mail.Body = "blablabla"
mail.BodyFormat = MailFormat.Html
SmtpMail.SmtpSe rver = "mydomain.c om"
SmtpMail.Send(m ail)

The problem is that I get the error message
An unhandled exception of type 'System.Web.Htt pException' occurred in
system.web.dll
Additional information: Could not access 'CDO.Message' object.

I tried changing smtpserver to myexchangeserve r.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.goo gle.com...
I have an application running on a single workstation (win 2000) with
Outlook installed and a profile create using and exchange server with
authentificatio n 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*******@mydo main.com"
mail.To = "an************ @mydomain.com"
mail.Subject = "test msg"
mail.Body = "blablabla"
mail.BodyFormat = MailFormat.Html
SmtpMail.SmtpSe rver = "mydomain.c om"
SmtpMail.Send(m ail)

The problem is that I get the error message
An unhandled exception of type 'System.Web.Htt pException' occurred in
system.web.dll
Additional information: Could not access 'CDO.Message' object.

I tried changing smtpserver to myexchangeserve r.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.goo gle.com...
I have an application running on a single workstation (win 2000) with
Outlook installed and a profile create using and exchange server with
authentificatio n 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*******@mydo main.com"
mail.To = "an************ @mydomain.com"
mail.Subject = "test msg"
mail.Body = "blablabla"
mail.BodyFormat = MailFormat.Html
SmtpMail.SmtpSe rver = "mydomain.c om"
SmtpMail.Send(m ail)

The problem is that I get the error message
An unhandled exception of type 'System.Web.Htt pException' occurred in
system.web.dll
Additional information: Could not access 'CDO.Message' object.

I tried changing smtpserver to myexchangeserve r.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**********@b onlalum.com"
iMsg.To = "st**********@b onlalum.com"
iMsg.HTMLBody = "samia"
iMsg.Send()

any other ideas???

Thanks

Samia.
"Darshan Mehta" <ob*****@hotmai l.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.Newsgr oups and IMessage.Subjec t 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**********@b onlalum.com"
iMsg.To = "st**********@b onlalum.com"
iMsg.HTMLBody = "samia"
iMsg.Send()

any other ideas???

Thanks

Samia.
"Darshan Mehta" <ob*****@hotmai l.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.Newsgr oups and IMessage.Subjec t 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**********@b onlalum.com"
iMsg.To = "st**********@b onlalum.com"
iMsg.HTMLBody = "samia"

iMsg.Configurat ion.Fields["http://schemas.microso ft.com/cdo/configuration/se
ndusing"].Value = 2;

iMsg.Configurat ion.Fields["http://schemas.microso ft.com/cdo/configuration/sm
tpserverport"].Value = 25;

iMsg.Configurat ion.Fields["http://schemas.microso ft.com/cdo/configuration/sm
tpserver"].Value = strMailServer;
iMsg.Configurat ion.Fields.Upda te();

iMsg.Send()

Hope this helps

Thys Brits
MCSD/MCAD

"Samia" <sa************ *@hotmail.com> wrote in message
news:1d******** *************** ***@posting.goo gle.com...
I have an application running on a single workstation (win 2000) with
Outlook installed and a profile create using and exchange server with
authentificatio n 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*******@mydo main.com"
mail.To = "an************ @mydomain.com"
mail.Subject = "test msg"
mail.Body = "blablabla"
mail.BodyFormat = MailFormat.Html
SmtpMail.SmtpSe rver = "mydomain.c om"
SmtpMail.Send(m ail)

The problem is that I get the error message
An unhandled exception of type 'System.Web.Htt pException' occurred in
system.web.dll
Additional information: Could not access 'CDO.Message' object.

I tried changing smtpserver to myexchangeserve r.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
12081
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 use PHP to get inside an OWA (Microsoft Outlook Web Access) website to send email that way? The reason I ask is because my corporate office is going to do away with our rogue SMTP server access and force everything through Exchange
3
2096
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, I want to display orange checkbox2 - when checked, I want to display apples checkbox3 - when checked, I want to display grapes If all three checked, I want to display in one column: orange apples
0
1019
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$ Exchange? The computer where this app should be working has its own M$ Exchange server, all extra ports like POP3/SMTP are blocked and I have no way to use any external mail server, but I need to send an email message with some confirmation, actually to...
9
4304
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, VisualStudio2002, VB as programing language. Our test/development version of the web app as hosted on our "localhost" works fine; our "Default SMTP Virtual Server" is running (per the IIS console).
3
1712
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
6285
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 SmtpMail.Send"mymail@gmx.net", "somebody@xxx.ch", "sub",
6
3956
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 What does this mean? Thanks, Jim.
9
18104
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 with simply installing Outlook. Well I guess I am looking for the "elegant" solution :O) Thanks Paul
17
7638
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 following table that lists a building manager's name, e-mail address and their building, is there a way that I can automate this to send these monthly e-mails from Outlook. Ideally this would be a click one button type of action:
2
3746
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 internet mail addresses. (mailboxes on our network), However, when attempting to send mail to an outside address (ex: someone at gmail dot com) the mail() returns "failed".
0
8610
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8810
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7633
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6462
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5821
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4325
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2977
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1961
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.