By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,470 Members | 994 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,470 IT Pros & Developers. It's quick & easy.

Automatic Emails out of Access

P: 3
I have several databases that send out multiple reports in multiple emails at the click of a button on the main screen as needed.

To avoid the 5 second countdown time that pops up I use a freeware program called "ClickYes" that bypasses this problem and prevents me from having to wait to approve each individual email.

My question: Is there any way to do this within the database without having to use an external program?
Feb 18 '20 #1
Share this Question
Share on Google+
6 Replies


twinnyfo
Expert Mod 2.5K+
P: 3,385
JEBritt,

It depends. Outlook allows you to send e-mails directly from Access. However, most companies with Outlook also manage their clients so that such things can't be done directly through VBA. Likewise, such organizations also require you to use the MS Exchange Server, which limits OTS software that might be able to circumvent such security protocols. I have just learned to live with disappointment. Security protocols are there for a reason. I can easily click send on a hundred e-mails, rather than type them up from scratch, so I am still better off.

Just my two cents.

Hope it hepps!
Feb 18 '20 #2

100+
P: 110
If you use Mincrosoft Outlook,
perhaps this code sends an email without security warning.
Add "Microsoft Outlook XX.X Object Library" in tool-> reference.

Expand|Select|Wrap|Line Numbers
  1. Dim objOutlook As Outlook.Application
  2. Dim objMsg As Outlook.MailItem
  3. Set objOutlook = New Outlook.Application
  4. Set objMsg = objOutlook.CreateItem(olMailItem)
  5. objMsg.Body = "Body goes here"
  6. objMsg.Subject = "Subject goes here"
  7. objMsg.Recipients.Add "Email@Address.com"
  8. objMsg.Send
Feb 19 '20 #3

twinnyfo
Expert Mod 2.5K+
P: 3,385
Sio,

Yes, this will work in an un-managed environment. At our office, the network security experts have disabled that ability.
Feb 19 '20 #4

100+
P: 110
Hi twinnyfo.
How is it control?
How do it know it's vba code?
Please tell me there are interested.
thanks.

If direct mailing is disabled with security, run up to the point where display the mailer.

Expand|Select|Wrap|Line Numbers
  1. Dim objOutlook As Outlook.Application
  2. Dim objMsg As Outlook.MailItem
  3. Set objOutlook = New Outlook.Application
  4. Set objMsg = objOutlook.CreateItem(olMailItem)
  5. objMsg.Body = "Body goes here"
  6. objMsg.subject = "Subject goes here"
  7. objMsg.Recipients.Add "Email@Address.com"
  8. objMsg.Display
Feb 19 '20 #5

twinnyfo
Expert Mod 2.5K+
P: 3,385
Sio,

1. I am not a network guy.

2. I am not a security guy.

So, I don't know "how" it works, but managed systems are able to know when a software application is trying to send data either out of or into your system through the network "when not prompted by user action."

So, yes, the "solution" in these cases is to get to the .Display statement. If your code is cycling through a series of records with multiple e-mails, your system will generate and display a series of e-mails that you simply have to click "Send" on.

Because our systems use encryption and Smart Card authentication, this generation of multiple e-mails simultaneously can almost cripple our activity, so, I simply add MsgBox "Next" after each .Display statement and the user then clicks "Send", then "Next" and it will hog fewer resources.

Again, these are work-arounds because of the managed systems. VBA/Outlook Automation is designed to be able to send the e-mails directly from your code. But, in the name of network security, this is often disabled at the enterprise level.

Hope that makes sense--I'm only using language that I can comprehend, since it's outside my realm of expertise. I don't know if rollerbladegirl might have more insight on this--I think she's a network security person. I'll send her a note to check out this thread to see if she has any insight.

Hope this hepps!
Feb 20 '20 #6

Rabbit
Expert Mod 10K+
P: 12,401
There's also the option of using the CDO object that avoids having to automate Outlook.
Feb 20 '20 #7

Post your reply

Sign in to post your reply or Sign up for a free account.