error_prone
asked on
CDO Question
Can someone give me a quick example on how to use CDO to send an email from either a macro or a button? I'm using Outlook and Access 2007. Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here is a working example:
http://www.candace-tripp.net/download/emailcdo2k.zip
http://www.candace-tripp.net/download/emailcdo2k.zip
E-Mail to Multiple Recipients Using CDO Object
ends e-mail to multiple recipients using the CDO object (cdonts.dll)and stores the addresses in the database.
ASKER
Says it's missing a reference to cdonts.dll. How do I reference it?
ASKER
I downloaded and registered the dll but when I try to send an email it says "Error. Message not delivered to selected recipeints."
ASKER
Is there anything wrong with the example I posted above?
ASKER
I even put a message box at the end of the code to see if it ran all the way through. I get the message box but never the email.
ASKER
I took out the OnError line on the code I used above and am now receiving the following error:
The "SendUsing" configuration value is invalid. How can I fix this?
The "SendUsing" configuration value is invalid. How can I fix this?
SendUsing refers to the SMTP server that you're using. Are you absolutely sure that (a) you have a valid, configured SMTP server on the network and (b) you can send email in this fashion using the SMTP server? You'll have to ask your IT people about this, if you have any. If not, explain a little more about your network configuration - are you using Exchange for emails, for example? Are you using Outlook?
This article might help:
http://technet.microsoft.com/en-us/library/ee176585.aspx
This article might help:
http://technet.microsoft.com/en-us/library/ee176585.aspx
ASKER
Outlook 2007 and yes it's an Exchange server. Is there a way I can make sure if I'm using the right smtp server?
ASKER
I'm running this on a company network. Are there certain network settings that will prevent the email from sending but won't give me an error?
Public Function SendNotesMail()
Dim objEmail As Object
On Error Resume Next
Set objEmail = CreateObject("CDO.Message"
objEmail.From = "me.me@mydomain.com"
objEmail.To = "me.me@mydomain.com"
objEmail.subject = "testing the subject"
objEmail.TextBody = "testing the email body."
'If strAttach <> "" Then objEmail.AddAttachment strAttach
objEmail.Configuration.Fie
objEmail.Configuration.Fie
objEmail.Configuration.Fie
objEmail.Configuration.Fie
objEmail.Send
'If Err.Number <> 0 Then
'Else
'End If
Set objEmail = Nothing
End Function