Email automation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Parasyke

    #1

    Email automation

    I've written several SubRoutines for sending reports via embedded A97
    VBA to OUtlook, but was wondering if there's a way to send from
    Access/Outlook 2000 a daily email letting certain users know that my
    backups of their databases ran. I'd like to do this from the push of a
    button.

    In Access97 I was using the trusty:

    DoCmd.SendObjec t acSendReport, "MyReport", _ acFormatRTF,
    "JohnDoe@abcde. com", , "Here is your report", , False

    But now I'm in A2000 and just want to send a message, without an
    attachment. Just need "To" "Recipients " "Subject" "Body of Message"

    So I need some syntax help with my button if anyone has ever done this??

  • Cyberwolf

    #2
    Re: Email automation

    instead of "acSendRepo rt use acSendMoObject, and delete the "MyReport"
    and acFormatRTF

    Comment

    • Cyberwolf

      #3
      Re: Email automation

      instead of "acSendRepo rt use acSendNoObject, and delete the "MyReport"
      and acFormatRTF

      Comment

      • Parasyke

        #4
        Re: Email automation

        Thanks! That works fine.... one more thing: What to do about handling
        carriage returns when the body of the email is long like:

        "mcrClients ran at 6:30am 4/18 (for SA)
        mcrQM_Pressmen ran at 7:15pm 4/17 (for QM)
        mcrIncoming ran at 7:15pm 4/17 (for FG)
        mcrQMgmt ran at 7:15pm 4/17 (for QM)"

        Comment

        • Ron2005

          #5
          Re: Email automation

          "mcrClients ran at 6:30am 4/18 (for SA) " & char(13) & _
          "mcrQM_Pres smen ran at 7:15pm 4/17 (for QM) " & char(13) & _
          "mcrIncomin g ran at 7:15pm 4/17 (for FG)" & char(13) & _
          "mcrQMgmt ran at 7:15pm 4/17 (for QM)" & char(13)

          or the whole thing as a single string without the _

          Comment

          • FMS Development Team

            #6
            Re: Email automation

            Our new Total Access Emailer program will do the trick. It can now
            send filtered reports (or tables or queries) to each recipient.

            We have a free beta going right now, so you should try it and let us
            know how it works. Rather than Outlook, it uses SMTP to avoid the
            security issues with Outlook/MAPI. Visit
            Send personalized email using data and reports directly from your Microsoft Access database with Total Access Emailer from FMS


            If you are concerned about system adminstrative tasks like compacts and
            backups, try our Total Visual Agent program. That automates the whole
            process and lets you schedule events at night with a complete audit
            trail of what was done. It can manage an unlimited number of databases
            across your network and notify you via email if a problem occurs. It
            can also run as an NT service so you can perform the tasks securely and
            handle computer crashes.

            Visit http://www.fmsinc.com/products/agent/index.html where you can get
            a fully functional 30 day demo version of Total Visual Agent.

            Luke Chung
            President
            FMS, Inc.
            Microsoft Access products, addins, developer tools, consulting services for Visual Studio .NET, SQL Server, Azure PowerApps, PowerBI in Vienna, Virginia Washington DC


            Comment

            • Parasyke

              #7
              Re: Email automation

              Since your on a role... the above worked (THANKS!),

              How can I put a variable date in the above?

              I tried this (but got a compile error):

              "mcrClients ran at 6:30am" &Format(Date (), "mm/dd"& "(for SA)" &
              Chr(13) & _

              Comment

              • Ron2005

                #8
                Re: Email automation

                I think you left out a parenthesis (and some spaces, which you would
                have seen as soon as it worked).

                "mcrClients ran at 6:30am " & Format(Date(), "mm/dd") & " (for SA)" &

                Chr(13) & _

                I am assuming that the format is proper syntax

                Ron

                Comment

                • Parasyke

                  #9
                  Re: Email automation

                  Thanks! All is working properly now per below: (except0
                  .... one problem with syntax is lingering... I get a good carriage
                  return after the first two lines and the last two lines in this set,
                  but lines 3, 4, 5, 6 fail to get a carriage return and I get a
                  continuous string... see any errors?

                  "Dept. successfully did backups on all databases and executed macros
                  for feeds to MainData." & Chr(13) & _
                  "" & Chr(13) & _
                  "mcrClients ran at 6:30am " & Format(Date, "mm/dd") & " (for SA)" &
                  Chr(13) & _
                  "mcrQM_Pres smen ran at 7:15pm " & Format(Date, "mm/dd") & " (for QM)" &
                  Chr(13) & _
                  "mcrIncomin g ran at 7:15pm " & Format(Date, "mm/dd") & " (for FG)" &
                  Chr(13) & _
                  "mcrQMgmt ran at 7:15pm " & Format(Date, "mm/dd") & " (for QM)" &
                  Chr(13) & _
                  "" & Chr(13) & _
                  "Thanks!" & Chr(13) & _

                  Here's what gets sent:

                  Dept. successfully did backups on all databases and executed macros for
                  feeds to MainData.

                  mcrClients ran at 6:30am 04/19 (for SA)
                  mcrQM_Pressmen ran at 7:15pm 04/19 (for QM) mcrIncoming ran at 7:15pm
                  04/19 (for FG) mcrQMgmt ran at 7:15pm 04/19 (for QM)

                  Thanks!

                  Comment

                  • Ron2005

                    #10
                    Re: Email automation

                    Boy, you have an interesting situation.
                    I can't see any logical co-ordination between those that worked and
                    those that did not.
                    Since it is NOT acting logically (or we can't see the logic) try some
                    illogical solutions.

                    1)I always have my underscore "_" directly after the "&" and you have a
                    space there. It hardly seems that like that should do it, but it is
                    worth a try.
                    2) try adding an extra Chr(13) to the end of the offending line.
                    3) Maybe, create strings for line1, line2, line3 and line4, load then
                    before you get there and use the try

                    "Dept. successfully did backups on all databases and executed macros
                    for feeds to MainData." & Chr(13) & _
                    "" & Chr(13) & _
                    line1 & Chr(13) & line2 & Chr(13) & line3 & Chr(13) & line4 & Chr(13)
                    &_
                    "" & Chr(13) & _
                    "Thanks!" & Chr(13) & _

                    or
                    "Dept. successfully did backups on all databases and executed macros
                    for feeds to MainData." & Chr(13) & _
                    "" & Chr(13) &_
                    line1 & Chr(13) &_
                    line2 & Chr(13) &_
                    line3 & Chr(13) &_
                    line4 & Chr(13) &_
                    "" & Chr(13) &_
                    "Thanks!" & Chr(13) & _

                    Ron

                    Comment

                    • Parasyke

                      #11
                      Re: Email automation

                      Thanks! I found a work-around (see bottom of post)

                      The "1)I always have my underscore "_" directly after the "&" and you
                      have a
                      space there. It hardly seems that like that should do it, but it is
                      worth a try." ...... I tried this and it gave compile errors (I'm
                      using A2000 which may be the culprit, I don't recal seeing anything
                      this weird in A97.

                      Anyway I put a "" & Chr(13) & _ between each line like this:

                      "mcrClients ran at 6:30am " & Format(Date, "mm/dd") & " (for SA)" &
                      Chr(13) & _
                      "" & Chr(13) & _
                      "mcrQM_Pres smen ran at 7:15pm " & Format(Date, "mm/dd") & " (for QM)" &
                      Chr(13) & _
                      "" & Chr(13) & _
                      "mcrIncomin g ran at 7:15pm " & Format(Date, "mm/dd") & " (for FG)" &
                      Chr(13) & _
                      "" & Chr(13) & _
                      "mcrQMgmt ran at 7:15pm " & Format(Date, "mm/dd") & " (for QM)" &

                      .... and this work good enough for me ... with the results being:

                      mcrClients ran at 6:30am 4/18 (for SA)

                      mcrQM_Pressmen ran at 7:15pm 4/17 (for QM)

                      mcrIncoming ran at 7:15pm 4/17 (for FG)

                      mcrQMgmt ran at 7:15pm 4/17 (for QM)

                      Comment

                      • Ron2005

                        #12
                        Re: Email automation

                        Glad you found a workaround. Very unusual problem. Will have to
                        watch for it.

                        Ron

                        Comment

                        Working...