Gmail from MS Access, VBA, Excel, Word…

“Send a Secret Email”

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.
Video 1  (0:56)
Title MS Access DB
This video is of a demo MS Access database which shows you how to send an e-mail from Google mail using VBA.

Sending an Attachment:-

Alan Asked:-

If I wanted to take it to the next level and add an attachment to the Build a Message section of the code.  Under oMsg, what code would I add to have it grab a report or query and email it as an attachment.

If I wanted to add an attachment:

Add a line after “.textBody” and before “End With” like so:

.textBody = “From Keyed in Email Address”
.AddAttachment “H:\ADrive\YourFileName.txt”
End With

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn