Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Smtp email using access without CDO

Status
Not open for further replies.

forumpall

Programmer
Jan 9, 2013
5
US
I sent emails from my Access VBA using smtp and used the CDO to do it. Now, with Access 2010, I get an error 429 every time I CDO is in a line of code.

My research led me to a spot which said to uninstall 2010, install CDO 2.1, the re-install 2010, but this is unworkable in my environment.

Does anyone have a method to use smtp to send email without CDO? the only methods I've been able to find require you to use an Outlook account or have send rights for one. I really am looking for a solution where I can just use the SMTP without accessing an Outlook account.

Any help is appreciated.
 
CDO 2.1? Do you mean CDO 1.21? In which case consider using the somewhat better Microsoft CDO for Windows 2000 Library (CDOSYS.DLL), and which does not require Outlook
 
Sorry. I did mean CDO 1.21.

Where can I obtain the Microsoft CDO for Windows 2000 Library (CDOSYS.DLL)? My google search is not being very helpful.

 
Since this is a coding forum, posting your code might help.....
 
Below is my code. I get an error 429 at the Set Icfg line.

And it's odd. On my computer it worked OK, but none of the others work. My computer (when I check the registry) has the Microsoft CDO for Windows 2000 library at the CDO0000-... 1.0 spot. The others have "value not set" there.

It kinda looks like they have the CDOSYS.DLL file, but it is not the Microsoft CDO for Windows 2000 library

Function SendEMailTestPassThru()
Dim iCfg As Object
Dim iMsg As Object

Set iCfg = CreateObject("CDO.Configuration")
Set iMsg = CreateObject("CDO.Message")

With iCfg.Fields
.Item(" = 2
.Item(" = 25
.Item(" = "mailfromhamco.hamilton-co.org"
'.Item(" = 1
.Item(" = "HCPHCustServ"
'.Item(" = "MyPassordNotAlwaysNeeded"
.Item(" = "HCPHCustServ@hamilton-co.org"
.Update
End With

With iMsg
.Configuration = iCfg
'.Subject = "Subject"
.Subject = "Test"
'.To = "recipient.email@address.com.au"
.To = "Meredith.Adkins@hamilton-co.org"
.BCC = "HCPHCustServ@hamilton-co.org"
'.textBody = "MessageBody"
.textBody = "TEST"
.AddAttachment "x:\water\AerNoChargeInsp.pdf"
.Send
End With

Set iMsg = Nothing
Set iCfg = Nothing

End Function
 
Just a thought... I have used BLAT a DOS Based SMTP Email tool, to send short/simple emails without use of CDO or Outlook. htwh,

Steve Medvid
IT Consultant & Web Master
 
Thanks for your repsonse. Blat is my next thing to try. It's just that I have to install it on all the other computers and I was hoping to avoid that.
 
Since it is just an EXE you run, perhaps it can be installed on a server location. I have not used it in many years... but I do not think it modifies the local PC registry... but please confirm that guess... Plus better to have a central location of BLAT instead of on local PCs in case an update to software is required. Good luck...

Steve Medvid
IT Consultant & Web Master
 
I'm slightly confused. The code you show is for Microsoft CDO for Windows 2000, not CDO 1.21. SO your research will have lead you down the wrong road ...

ANyway, looks like CDOSYS may not be registered properly. Try looking at this:
 
This was very helpful.

I was able to unregister cdosys.dll, but it wouldn't let me register it, giving me the 0x8002081c error. I had to start a command prompt and "run as adminstrator" for it to register.

It appears to work, at least on two of the computers.

thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top