Send emails in Access (1 Viewer)

BlackOnBlack

Registered User.
Local time
Yesterday, 22:47
Joined
Apr 21, 2006
Messages
24
As a security measure on a database, I'd like to setup a Macro or Stored Procedure such that when the database is opened, it sends an email to a gmail account. I'd store the logon and password in the macro or stored procedure. It would be helpful if it also contained a line of data from one of the tables. Anyone have suggestions on how to do that or something similar?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 03:47
Joined
Jul 9, 2003
Messages
16,285
You might find my blog about sending email from Gmail here:-


Of interest.

Please note, since writing that blog, Gmail has changed its permissions, so you may have to take extra steps to get it to work. .
 

GPGeorge

George Hepworth
Local time
Yesterday, 19:47
Joined
Nov 25, 2004
Messages
1,899
As a security measure on a database, I'd like to setup a Macro or Stored Procedure such that when the database is opened, it sends an email to a gmail account. I'd store the logon and password in the macro or stored procedure. It would be helpful if it also contained a line of data from one of the tables. Anyone have suggestions on how to do that or something similar?
You could add this to an AutoExec macro, but you do understand that the user will almost have to be aware of this email being sent?
There is a macro action to send email, or you could write a VBA procedure to do that, and execute it from the AutoExec macro.

That said, a savvy user can bypass your startup code, so if this truly is a security step, it might not be that effective. The user could potentially even modify the macro that was supposed to send the email! Of course if you distribute it as an accde that's less of a concern. Still if you want to do it, you can send the email via a gmail account. I see at least one such link already.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 21:47
Joined
Feb 28, 2001
Messages
27,217
Depending on system security settings, it is quite possible that a user could block - or at least be given the option to block - an outgoing e-mail. You have a gauntlet of issues. The address to which you send the mail is usually not a problem but...

First, if you use Outlook, it can be told as a matter of site or manual policy to disallow automation e-mail sending.

Second, even if you use something like CDO (Collaboration Data Objects) - which can also send e-mail - you have to get through your SMTP Gateway server, which will probably be protected by a firewall. These days, it is possible to set the firewall to block things NOT sent via Outlook.

Third, as GPGeorge points out, it IS possible to bypass your startup code or modify your code depending how it is distributed.

Fourth, storing a login and password in a procedure when there are all sorts of tools out there to disassemble your code? Invites account compromise and spoofed e-mails.
 

Users who are viewing this thread

Top Bottom