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!
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!