Pages

Saturday 2 February 2013

Sending Google Mail (Gmail) from MS Access, VBA, Excel, Word...

Escape From Outlook
Microsoft tightly combine their applications together however sometimes it’s nice to escape from Microsoft Products and use others.  Here I demonstrate how you can use Google Mail to send out an e-mail from an Internet connected PC, and you can also do this covertly!

 This Example is From:

Windows® XP Under the Hood, Pg. 266 Chapter 6 Messaging and Faxing ObjectsExtract
 This basic example sends a simple, no-frills text message every time the script is run: Example File: script0603.vbs As you can see, the original file was a VBScript file; I have converted this to VBA.

Google e-mail Account
I have also set up a Gmail account to send the emails through.  You are welcome to use this account for testing, however I suggest you set up your own Gmail account and change the hard coded information where necessary if you intend using this code for your own purposes.


Gmail From MS Access (the Video)


Text from the above Video

This video is of a demo MS Access database which shows you how to send an e-mail from Google mail using
VBA.  Press the “Send a Test Email” button and wait and then you get this message saying that the message sent is "True". It doesn't necessarily mean the message has been sent, it just means the code operated successfully. It is not necessary to have that confirmation message appear, this can be hidden, hence you have the ability to send email from your application covertly!


Thank You

BTW there should be a Demo DB linked to from this Video.

 

I was not happy with the original file, so I have replaced it.  If you want the original file then it is available , you will find it at the bottom of my next post in this thread.  

 

Use this Updated Version HERE: UpdatedGoogleMail.mdb

 

Text Version of Code (VBA) for use in older versions of MS Access and other Microsoft Products like MS Excel, MS Word, etc... : GoogleMailFromMS_Access_VBA_CODE.txt

No comments: