<%dim crumb crumb="VBA Access Email Outlook" Crumb2="Send Email From Access" crumb1="Create Outlook Email Using Access VB" %> Send Outlook Email from VBA
Home  Fees/Services  Access 2010 Template  Access Tutorial  Access Download  Articles  Search  Contact  Privacy  Links

<%if len(crumb2)>2 then response.write crumb2 else response.write ">
<% response.write crumb1 %>

Visual Basic Tutorials:
Access-Google Earth
Age Calculation
Change To Proper Case
Email via Gmail #1
Send Gmail Email #2
Inactivity Logout Code
Outlook Email
Read Email Access
Email Attachment
Send Outlook Email
Running Sum
Denormalize Records
Stock Quotes
Find Database Path
Detail-Master Update
Data Field Validation
Field Value New-Old
Access Version
Global Variable Parameter
Global Variables
Active Labels
Files List Box
Mail Merge
Quick Sort
Recordset Filters
Reference Form Field
Select Case
Access Transactions

Visual Basic Function Examples

Send Outlook Email from Access

Send email to outlook from an Access form can really enhance the capability of your contact management database.  In this example we add a button automatically launch outlook using the contact's email address contained on the form.
Run MS Outlook Access Form The first step is to locate the e-mail client, outlook.exe, on the system that uses the application. For example on the Windows XP Professional operating system using Office XP with a standard installation the outlook client can be found in C:\Program Files\Microsoft Office\Office10. You can simply hard code the location of the e-mail client directly into your code but I prefer to store it in a table, giving the user a simple interface to the table where they can enter the location themselves if necessary.

We have three examples showing how you can make your Access database interact with Outlook Email functions:

The concept behind this is to use outlook command line options to launch an e-mail message with the address from the form.

New! Download Access example of  Sending Email to Outlook
  • Simply add a button to the form and in the OnClick event add the following code. Note that the e-mail address is in a control named ContactEmail in this example.

    Private Sub btnEmail_Click()
    Dim EmailClient As Variant
    Dim stAppName As String
    Dim ClientName As String

    On Error GoTo Err_btnEmail_Click

    � Look up the base directory of the e-mail client in table EmailClient
    EmailClient = Trim(DLookup("OutLookAddress", "EmailClient"))
    If IsNull(EmailClient) Then
        ' Open a simple form asking the user to enter the base directory
        DoCmd.OpenForm "EmailClient", , , , acFormAdd
        If Not IsNull(Me!ContactEmail) And Not IsNull(EmailClient) Then
            ' if there is a \ on the end remove it
            If InStr(Len(EmailClient), EmailClient, "\") Then
                EmailClient = Left(EmailClient, Len(EmailClient) - 1)
            End If
            � add the outlook client, set the command line options, add the form address
            stAppName = EmailClient & "\outlook.exe /c ipm.note /m " & Me!ContactEmail
            � Launch Outlook
            Call Shell(stAppName, 1)
            MsgBox "The Email Client or Email Address is Null, please enter it"

        End If
    End If
    Exit Sub

    MsgBox Err.Description
    Resume Exit_btnEmail_Click

    End Sub

    The important command line information is on the line

    stAppName = EmailClient & "\outlook.exe /c ipm.note /m " & Me!ContactEmail


  •  /c indicates create an object

  •  ipm.note specifies that you want an e-mail message

  •  /m says use the following e-mail address in To:

  •  Me!ContactEmail pulls the e-mail address from the form

Microsoft Office:
MS Access 2000 Through 2016 and Office 365 & Sharepoint

Contact Information

<% Response.write "Copyright 2000-" & year(now) & " Blue Claw Database Design" %>

Microsoft Access 2007, 2010, 2013 & 2016