Results 1 to 6 of 6
  1. #1
    craig1988 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2014
    Posts
    82

    Confirming if an email has been sent or not

    Hi



    I have not been able to find a solution to this that fits.

    Basically I have a procedure below that generates a personalised email (pulling some data from a form). What I would like to be able to do is log to an event table if the email was then sent. If the user discards the eamil then no action will be needed.

    Code:
    Private Sub btnActivate_Click()    On Error GoTo Err_Handler
        Dim ALL RELEVANT VARIABLES        
        Set Instance of outlook etc...    
        
        With objMail
           .BodyFormat = olFormatHTML
           .To = vTo
           .CC = vCC
           .Subject = "Blah"        
           .Display
        End With
        'Reset the outlook variable
        Set objMail = Nothing
        Set olApp = Nothing
           
    Exit_Handler:
        Exit Sub
    Err_Handler:
        Resume Exit_Handler
    End Sub

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    No need to check - you will get an error if it doesn't get sent.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Quote Originally Posted by aytee111 View Post
    No need to check - you will get an error if it doesn't get sent.
    That's true with SendObject, I'm not sure it is with automation. In a brief test I didn't get an error.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Good point. One would need to force an error situation to test it.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I created an email with automation, using .Display, and cancelled the email without sending as a user might do.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Another option is to make the message a form inside of Access instead of external, with a Send command button. Then you will have some control over it.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Basic Database Design - Confirming my Learning
    By robbeh in forum Database Design
    Replies: 2
    Last Post: 01-02-2015, 02:26 PM
  2. Replies: 5
    Last Post: 05-07-2014, 09:25 AM
  3. Replies: 1
    Last Post: 05-01-2014, 11:37 AM
  4. Confirming closing database
    By Uudistaja in forum Forms
    Replies: 10
    Last Post: 03-01-2011, 02:28 PM
  5. Question about confirming delete record operation.
    By tdanko128 in forum Programming
    Replies: 1
    Last Post: 02-09-2011, 09:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums