Results 1 to 2 of 2
  1. #1
    mollywm94 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2019
    Posts
    1

    Automatic Emailing

    I'm trying to build a data base using Excel or Access, where if one cell changes from No to Yes it sends an automatic email to a given email address with only one row of information not the whole document.
    And for each row to have different emails etc.
    Like a client based system which will inform our clients that their delivery has been sent etc.
    If that makes sense?
    I have asked Microsoft and they told me to call, which i did and then they ended up hanging the phone up on me.
    Ive tried many forums and online tutorials but no one seems to be creating what i want.
    Please help if you can!!

    To make it simple
    1) How to automatic email when a cell has changed
    2) How to make this email have only a little bit of information



  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,387
    this link looks pretty close to what you are looking for using excel. You will need to learn how to adapt the examples you find online

    https://www.rondebruin.nl/win/s1/outlook/amail6.htm

    suggest you would use the worksheet change event

    first check the change is in range and if so and that the target value=Yes then send the email. Something like this - adapted from the code in the link.

    Code:
    Private Sub Worksheet_Change(ByVal Target as Range)
    Dim OutApp As Object
    Dim OutMail As Object
    
    if target.count=1 and target.column=8 and target.row>1 then '(8=column H, >1 assumes first row is a header row)
    
       With Application
            .EnableEvents = False
            .ScreenUpdating = False
        End With
        
       Set OutMail = OutApp.CreateItem(0)
       With OutMail
           .to = target.Offset(0, -1)'assumes email is in previous column to Y/N column
           .Subject = "Testfile"
           .Body = "Hi " & target.Offset(0, -2) 'assumes name is in next previous column to Y/N column
           .Body=.body & vbcrlf & "Happy New Year"
           .Send  'Or use .Display
       End With
    
       Set OutMail = Nothing
       Set OutApp = Nothing
       
        With Application
            .EnableEvents = True
            .ScreenUpdating = True
        End With
    
    end if
    
    end sub

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

Similar Threads

  1. Emailing a PDF
    By Gina Maylone in forum Access
    Replies: 4
    Last Post: 04-13-2015, 11:37 AM
  2. automatic report export/emailing
    By broecher in forum Programming
    Replies: 6
    Last Post: 01-29-2015, 03:21 PM
  3. Emailing example
    By pkstormy in forum Code Repository
    Replies: 4
    Last Post: 01-31-2014, 04:22 PM
  4. Emailing one Record
    By GGCR in forum Import/Export Data
    Replies: 6
    Last Post: 01-20-2014, 09:06 AM
  5. Emailing
    By fastebs in forum Access
    Replies: 2
    Last Post: 04-13-2012, 12:37 AM

Tags for this Thread

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