Sending an email with CBO

G37Sam

Registered User.
Local time
Tomorrow, 00:42
Joined
Apr 23, 2008
Messages
454
Hey Fellas,

What I'm trying to do, is to have access send an email via outlook. The sendobject method keeps giving me some sort of security error which upon research I found, that it would be better to use CBO method.

So here's my code:

Code:
Sub test()
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Example CDO Message"
objMessage.From = "someemail@someemail.com"
objMessage.To = "someemail@someemail.com"
objMessage.TextBody = "This is some sample message text."
objMessage.AddAttachment "c:\login.txt"
objMessage.Send
End Sub

Everytime I run that code, I get the following error:

errorujq.png


I'd appreciate any help I could get

Regards,
Sam
 

Users who are viewing this thread

Back
Top Bottom