Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Emailing individual reports to many customers automatically

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: Emailing individual reports to many customers automatically

    O.k., I'll try it again later on today with a clean installation of windows and A5 but isn't it strange that there is a loop that pauses for someone to press OK? Kind of defeats some of the object !
    Thanks again,
    Trevor.

    Comment


      #17
      Re: Emailing individual reports to many customers automatically

      Hi Stan, I've done a clean xp and V8 full DL and patch installation on a different computer. It does now loop through all the reports but with the OK screen. Each time now though, I get a message that says that the pdf can't be created.
      Is the pdf creator a part of A5, if not do you know if it would it be o.k. just to download an adobe reader or would I need to buy a writer?
      Is there a basic command to simulate a carriage return?
      Thanks again,
      Trevor.

      Comment


        #18
        Re: Emailing individual reports to many customers automatically

        Until Stan responds - the creation could have to do with the folder you entered (temp) not existing/
        Alpha creates the pdf itself. Just test with another folder on your HD and set a .pdf name to that.

        at present you have somthing like
        :report.SaveAs("AccMonthly","PDF",query.filter,query.order,a5.get_path()+chr(92)+"temp"+chr(92)+" Acct "+tbl.cuscode+".pdf")
        :report.SaveAs("AccMonthly","PDF",query.filter,query.order,'c;\testdir\.pdf")

        and the same in email_send(to

        Comment


          #19
          Re: Emailing individual reports to many customers automatically

          Thanks for the assist, Ray.

          Tony,

          Your updated sample database still had the ui_msg_box() in it. That generates the popup displaying the current customer code which was just there for testing. Remove it. I did that and added a section to create the temp directory if it does not exist.

          Code:
          parentform.commit()
          tbl = table.current()
          tbl.fetch_first()
          while .not. tbl.fetch_eof()
          query.filter = "cuscode = "+quote(alltrim(tbl.cuscode))
          query.order = ""
          to_param = Lookup("clients","cuscode = "+quote(alltrim(tbl.cuscode)),"alltrim(email)")
          cc_param = a5_eval_expression("",local_variables())
          bcc_param = a5_eval_expression("",local_variables())
          subject_param = "Monthly account from Laprima S.L."
          message_param = "Your attached account covers the month of "+cmonth(date())+"."
          if filefind.get(a5.Get_Path()+chr(92)+"temp",FILE_FIND_DIRECTORY,"PN") = ""
          	dir_create(a5.Get_Path()+chr(92)+"temp")
          end if
          :report.SaveAs("AccMonthly","PDF",query.filter,query.order,a5.get_path()+chr(92)+"temp"+chr(92)+" Acct "+tbl.cuscode+".pdf")
          email_send(to_param,subject_param,message_param,a5.get_path()+chr(92)+"temp"+chr(92)+" Acct "+tbl.cuscode+".pdf")
          sleep(1)
          tbl.fetch_next()
          end while
          There can be only one.

          Comment


            #20
            Re: Emailing individual reports to many customers automatically

            Thanks, Ray. I did forget to create the temp folder in the new installation but now I get "cannot load profile" after pressing the first OK button.
            Regards,
            Trevor.

            Comment


              #21
              Re: Emailing individual reports to many customers automatically

              Thank you both.
              My code in the OnPush window is now exactly the same as yours. I still get "cannot load profile". When I push the button I see (very briefly) the 'Now printing' box followed almost immediately by the 'Cannot load profile' Box. No OK box now.
              Trevor.

              Comment


                #22
                Re: Emailing individual reports to many customers automatically

                Do you have a profile set up? If not, can you set one up? If you can't there are other email functions that don't require a profile.
                There can be only one.

                Comment


                  #23
                  Re: Emailing individual reports to many customers automatically

                  Yes I have set up an email account and it works, in and outgoing mail.
                  Trevor.

                  Comment


                    #24
                    Re: Emailing individual reports to many customers automatically

                    You set up an email account and now everything is working or
                    you already had an email account set up and the email of the statements still gives the error "cannot load profile" ?
                    There can be only one.

                    Comment


                      #25
                      Re: Emailing individual reports to many customers automatically

                      Hi Stan,
                      I already had an email profile set up with Outlook. I've since set up a profile in A5 under tools\email\settings. I've tried it using this with 'Use A5 client', a box comes up which says ' AccMonthly to Alpha Five Printer on
                      then very briefly 'initializing'
                      then 'Page 1
                      Render
                      This stays on for a few seconds (I tried it with sleep (5) as well)
                      Then it all starts again with the AccMonthly to Alpha Five Printer on... etc.. Occasionally I see a 'Generating tables and Sets' message.
                      I have to use Ctrl-Alt-Delete to stop it. There is nothing in the sent box of OE, but there are 4 pdf files in the Temp folder and they are consecutive and each one is correct (the correct pdf for the correct Acct name).
                      Must be getting somewhere ! Do you think I should leave it to see if it's just slow and I stopped it after just 4 records processed?
                      Trevor.

                      Comment


                        #26
                        Re: Emailing individual reports to many customers automatically

                        With no error messages I think we are getting somewhere. I would let it run with a sleep(1). Temporarily change the to_param to a known address, your own if you want, and see if the emails are being sent.
                        There can be only one.

                        Comment


                          #27
                          Re: Emailing individual reports to many customers automatically

                          I've tried everything I can think of. From my very limited knowledge of the code, it seems that the report should first be saved and then sent (from the temp file). It doesn't seem to be doing this. If there is a file in this temp folder, which did occur (don't know how now) it just keeps sending the same report. In one email address I received over 100 of the same report. On one machine, using A5 email client, I get the error message;
                          "Error
                          File not found: 'C;\Program files\A5V8\Updated Laprima\temp\Acct 002.pdf'
                          Next time it goes to same message with 004 and then goes no further - there were these 2 reports in the folder. When I delete them it says cannot connect to email client.
                          Regards,
                          Trevor.

                          Comment


                            #28
                            Re: Emailing individual reports to many customers automatically

                            If I was correct about save to temp and email from temp, I tried removing the line;
                            email_send(to_param,subject_param,message_param,a5.get_path()+chr(92)+"temp"+chr(92)+" Acct "+tbl.cuscode+".pdf")
                            sleep(3)
                            from the code so that it would just save the pdf to the temp file (Ithink). I left in the uimessage line.
                            It looped through 002 and on to 004 (record#2) and then just kept going around 004 forever. There were no files i the temp folder.
                            Don't know whether this helps.
                            Trevor.

                            Comment


                              #29
                              Re: Emailing individual reports to many customers automatically

                              Don't know what to suggest now. It works perfectly here.

                              Maybe compact your database?
                              There can be only one.

                              Comment


                                #30
                                Re: Emailing individual reports to many customers automatically

                                O.k., thanks for trying. I've compacted and still the same, just a couple of final questions;
                                Are you using your default email client or the A5 one?
                                Am I correct in saying that the code should save the pdfs and then send them from that file?
                                Is it important that the customer codes are not consecutive?
                                If that is the case, if you remove the email_send portion should the pdfs be saved in the temp folder which is inside the database folder? Sometimes they are saved but only one or two, no more?

                                Thanks again,
                                Trevor.

                                Comment

                                Working...
                                X