Access 2003 and CDO for email

F

Francisco Gomez

I'm a bit confused. I neded to send email from Access 2003, and CDO look the
easiest way. I added a reference 'Microsoft CDO for Windows 2000 Library" and
added this code to the 'Click' event of a button:

Dim ObjetoMail As Object

' Create CDO object
Set ObjetoMail = CreateObject("CDO.Message")
' Configura email
ObjetoMail.To = "taget_address@taget_domain.com"
ObjetoMail.From = "My Account<source_account@my_account_domain.com>"
ObjetoMail.Subject = "The subject"
ObjetoMail.HTMLBody = "I'm the body of the <b>message</b>"

' Sending mail
ObjetoMail.Send

' Destroying CDO
Set ObjetoMail = Nothing

And, surprisingly... IT WORKS PERFECTLY!!!

But i would need to be 'enlightened' in a couple of things:

- Where does the library I added in the reference (Microsoft CDO for Windows
200 Library) comes from? It's installed with the Windows XP, or Office, or
Outlook, or Visual Studio? I need to know it in order to install my Access
application in other PC's...

- ¿How did CDO connected to the SMTP? It didn't open Outlook Express, or
Outlook. The email was sent silently. Where did CDO got the info (servers,
users, passwords) to send the email? How do I know wich email addresses can I
use to send? How can I configure this default values?

- Finally, just curiosity, reading further, I have found some code allowing
me to specify all connection parameters. For example:

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"smtp.YourServer.com"

What does this URL to Microsoft means?

Thanks!
 
J

Joseph R. Pottschmidt

To answer your question as to where CDO was installed from, it comes
from the CD from the Office or Outlook CD. This is where the reference
library is installed from. In order to be able to install this
application on another machine, you're going to need to install the CDO
library on each machine that will be running your application. I'm
assuming since you are running Office 2003, that this will not be a
problem that you're going to have all the machines with the same
installation of office 2003.

As to the rest of your questions, those are all based on the local
configuration as to what the default mail client his and the
corresponding profile and or exchange profile that is currently
configured for each user on that particular workstation.

If you need any more details, please let me know.

Joe P.




-----Original Message-----
From: Francisco Gomez [mailto:[email protected]]
Posted At: Monday, July 31, 2006 5:12 AM
Posted To: microsoft.public.access.modulesdaovba
Conversation: Access 2003 and CDO for email
Subject: Access 2003 and CDO for email

I'm a bit confused. I neded to send email from Access 2003, and CDO look
the
easiest way. I added a reference 'Microsoft CDO for Windows 2000
Library" and
added this code to the 'Click' event of a button:

Dim ObjetoMail As Object

' Create CDO object
Set ObjetoMail = CreateObject("CDO.Message")
' Configura email
ObjetoMail.To = "taget_address@taget_domain.com"
ObjetoMail.From = "My Account<source_account@my_account_domain.com>"
ObjetoMail.Subject = "The subject"
ObjetoMail.HTMLBody = "I'm the body of the <b>message</b>"

' Sending mail
ObjetoMail.Send

' Destroying CDO
Set ObjetoMail = Nothing

And, surprisingly... IT WORKS PERFECTLY!!!

But i would need to be 'enlightened' in a couple of things:

- Where does the library I added in the reference (Microsoft CDO for
Windows
200 Library) comes from? It's installed with the Windows XP, or Office,
or
Outlook, or Visual Studio? I need to know it in order to install my
Access
application in other PC's...

- ¿How did CDO connected to the SMTP? It didn't open Outlook Express, or

Outlook. The email was sent silently. Where did CDO got the info
(servers,
users, passwords) to send the email? How do I know wich email addresses
can I
use to send? How can I configure this default values?

- Finally, just curiosity, reading further, I have found some code
allowing
me to specify all connection parameters. For example:

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"smtp.YourServer.com"

What does this URL to Microsoft means?

Thanks!
 
W

wromee

I'm also trying to send email from Access 2003. I tried CDO.Message object.
It gives no error message but the mail just does not go through. What is the
problem?

I have used DoCmd.SendObject so far. It works fine but Outlook warning
message appears and the user has to confirm to send the mail. Is there is a
way to disable this warning?

Romi
Joseph R. Pottschmidt said:
To answer your question as to where CDO was installed from, it comes
from the CD from the Office or Outlook CD. This is where the reference
library is installed from. In order to be able to install this
application on another machine, you're going to need to install the CDO
library on each machine that will be running your application. I'm
assuming since you are running Office 2003, that this will not be a
problem that you're going to have all the machines with the same
installation of office 2003.

As to the rest of your questions, those are all based on the local
configuration as to what the default mail client his and the
corresponding profile and or exchange profile that is currently
configured for each user on that particular workstation.

If you need any more details, please let me know.

Joe P.




-----Original Message-----
From: Francisco Gomez [mailto:[email protected]]
Posted At: Monday, July 31, 2006 5:12 AM
Posted To: microsoft.public.access.modulesdaovba
Conversation: Access 2003 and CDO for email
Subject: Access 2003 and CDO for email

I'm a bit confused. I neded to send email from Access 2003, and CDO look
the
easiest way. I added a reference 'Microsoft CDO for Windows 2000
Library" and
added this code to the 'Click' event of a button:

Dim ObjetoMail As Object

' Create CDO object
Set ObjetoMail = CreateObject("CDO.Message")
' Configura email
ObjetoMail.To = "taget_address@taget_domain.com"
ObjetoMail.From = "My Account<source_account@my_account_domain.com>"
ObjetoMail.Subject = "The subject"
ObjetoMail.HTMLBody = "I'm the body of the <b>message</b>"

' Sending mail
ObjetoMail.Send

' Destroying CDO
Set ObjetoMail = Nothing

And, surprisingly... IT WORKS PERFECTLY!!!

But i would need to be 'enlightened' in a couple of things:

- Where does the library I added in the reference (Microsoft CDO for
Windows
200 Library) comes from? It's installed with the Windows XP, or Office,
or
Outlook, or Visual Studio? I need to know it in order to install my
Access
application in other PC's...

- ¿How did CDO connected to the SMTP? It didn't open Outlook Express, or

Outlook. The email was sent silently. Where did CDO got the info
(servers,
users, passwords) to send the email? How do I know wich email addresses
can I
use to send? How can I configure this default values?

- Finally, just curiosity, reading further, I have found some code
allowing
me to specify all connection parameters. For example:

objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"smtp.YourServer.com"

What does this URL to Microsoft means?

Thanks!
 

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

Top