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

I cannot send batch /multiple emails

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

    I cannot send batch /multiple emails

    I was following this thread:
    http://msgboard.alphasoftware.com/al...mails+invoices


    I copy the following code in a script and when run, I get nothing, no errors or no email gets sent out.

    query.filter = "inv_date<={10/26/2011}.and.email<>\"\".and.mailed<>\"Y\""
    query.order = "inv_number"

    dim distribute_params as p
    distribute_params.email_field = "Email"
    distribute_params.layout_name = "invocemailMF"
    distribute_params.layout_type = "Report"
    distribute_params.filter = query.filter
    distribute_params.order = query.order
    distribute_params.flags = ""
    distribute_params.message = <<%txt%
    Hello this is a test email to a bunch of customers
    Sincerely,
    Mf group
    %txt%
    distribute_params.subject = "Invoice mf oct"
    distribute_params.create_log = .t.
    distribute_params.logfile_name = "c:\a_sales\layout_distribute_log.dbf"
    distribute_params.file_type = "pdf"
    distribute_params.cc_field = "clients->email"
    distribute_params.bcc_field = ""
    distribute_params.profile_name = "sales"
    distribute_params.store_in_outbox = .f.
    distribute_params.update_table = .t.
    distribute_params.update_field = "Mailed"
    distribute_params.update_expression_success = "\"Y\""
    distribute_params.update_expression_failed = "\"N\""

    Am I missing part of the code?

    #2
    Re: I cannot send batch /multiple emails

    Code:
    'Now send the e-mails, passing in the settings contained in the 'distribute_params' dot variable
    a5_layout_distribute(distribute_params)
    There can be only one.

    Comment


      #3
      Re: I cannot send batch /multiple emails

      Thanks for the response.
      "a5_layout_distribute()"
      I saw that part of the code and it gives the error "not recognized", so I did removed it.
      In one of your threads, you were questioning it, I understood it was part of the documentation not a function.
      In addition I can not find any detail or definition about a5_layout_distribute() .
      I am using A9.
      Any suggestion?

      Comment


        #4
        Re: I cannot send batch /multiple emails

        Could it be That I am not netmailer?

        Comment


          #5
          Re: I cannot send batch /multiple emails

          It does seem to be a Report Mailer function.
          There can be only one.

          Comment


            #6
            Re: I cannot send batch /multiple emails

            Since I do not have netmailer, is there another script to send batch emails?

            Comment


              #7
              Re: I cannot send batch /multiple emails

              Any email script can be put in a loop which selects addresses from a table and emails a file. The addresses can be selected one at a time or in groups.

              Are you sending one report to multiple customers or separate reports to each of many customers?
              There can be only one.

              Comment


                #8
                Re: I cannot send batch /multiple emails

                There will be 2 batch scenarios:
                1 Same email to every one in the client db with an email address.
                2 An invoice pertinent to the client with an email address.
                I guess the script will be very similar.
                Was there any script written before?

                Comment


                  #9
                  Re: I cannot send batch /multiple emails

                  I have found the following script from the manual.

                  dim message as C
                  query.filter = "between(recno(),1,1000)"
                  query.order = "recno()"
                  :Report.SaveAs("Invoice", "HTML", query.filter, query.order, "c:\test.htm", .F.)
                  wait_until(.F., 5, 5)
                  if file.exists("c:\test.htm") then
                  message = file.to_string("c:\test.htm")
                  end if
                  email_send("[email protected]", "HTML Message",message, "", "", "", .F., "HTML")
                  ----------------------
                  Obviously it needs additional criteria.
                  1 how to place the email of the individual client to the line of email_send

                  2 How to select/print individual invoice/record in the report?

                  As of now, if I place a proper email address, in the email_send, it will send the report for all invoices in one report.

                  Any quick fix?
                  I have attached a sample DB. The above code is located in the MainMenu Form in a button "send invoices"

                  Comment


                    #10
                    Re: I cannot send batch /multiple emails

                    For a button on the F_Main form, not the MainMenu form. Change the line.

                    1. email_send(alltrim(p_email.text), "HTML Message",message, "", "", "", .F., "HTML")

                    p_email.text is the text in the p_email object of the visible record on the F_Main form
                    Last edited by Stan Mathews; 10-29-2010, 12:00 PM.
                    There can be only one.

                    Comment


                      #11
                      Re: I cannot send batch /multiple emails

                      For a button on the F_Main form, not the MainMenu form. Change the line.


                      2. query.filter = "pqid = "+quote(pqid.text)

                      filters the report for the id of the currently visible record
                      There can be only one.

                      Comment


                        #12
                        Re: I cannot send batch /multiple emails

                        I did apply the change and it works well for a single email in the the fmain form.

                        My objective is to send invoice by email to all clients in the contact table.

                        I tried 3 different query.filter
                        query.filter = "between(recno(),1,1000)"
                        query.filter = "tbl2.pqid = "+quote(pqid.text)
                        query.filter = "pqid = "+quote(pqid.text)

                        The first works, but send the same report to all emails.
                        The other 2 gives an error that cannot find pqid

                        What would be the suggested filter syntax?
                        I put this code in the mainmenu in sendinvoices button.
                        I did attach the sample.
                        Here is the full code:
                        ========================

                        Dim tbl2 as P
                        dim message as C
                        tbl2 = table.open("Contacts")

                        tbl2.fetch_first()
                        while .not.tbl2.fetch_eof()
                        param_to = trim(tbl2.P_Email)

                        'query.filter = "between(recno(),1,1000)"
                        'query.filter = "tbl2.pqid = "+quote(pqid.text)
                        query.filter = "pqid = "+quote(pqid.text)

                        query.order = "recno()"
                        :Report.SaveAs("Invoice", "HTML", query.filter, query.order, "c:\test.htm", .F.)
                        wait_until(.F., 5, 5)
                        if file.exists("c:\test.htm") then
                        message = file.to_string("c:\test.htm")
                        end if
                        email_send(param_to, "HTML Message",message, "", "", "", .F., "HTML")

                        tbl2.fetch_next()
                        end while
                        tbl2.close()

                        Comment


                          #13
                          Re: I cannot send batch /multiple emails

                          Given

                          param_to = trim(tbl2.P_Email)

                          query.filter = "pqid = "+quote(tbl2.pqid)
                          There can be only one.

                          Comment


                            #14
                            Re: I cannot send batch /multiple emails

                            That did it.

                            As we think, we have done everything and still does not work yet, we are missing the obvious.

                            Thanks & Thanks Stan.

                            Comment


                              #15
                              Re: I cannot send batch /multiple emails

                              I have a new need to send email in a group basis.
                              Attached is a sample of the db.
                              When I press button 7, I get one email for each entry.
                              I would like to see only one email per account as it looks under the button #6 using jack.
                              In the cases were there are 3 entries for one account, the email will be correct with 3 lines, but will produce 3 emails of the same.

                              here is the code:

                              dim tbl2 as P
                              tbl2 = table.open("Contacts")

                              tbl2.fetch_first()
                              dim I as N
                              dim K as N
                              dim J as N
                              dim message as C
                              while .not.tbl2.fetch_eof()
                              param_to = trim(tbl2.P_Email)

                              query.filter = "pqid = "+quote(tbl2.pqid)

                              query.order = "recno()"

                              :Report.SaveAs("InvoiceByGroupList", "HTML", query.filter, query.order, "c:\test.htm", .F.)
                              wait_until(.F., 5, 5)
                              if file.exists("c:\test.htm") then
                              message = file.to_string("c:\test.htm")
                              end if
                              email_send(param_to, "HTML Message",message, "", "", "", .F., "HTML")

                              tbl2.fetch_next()
                              end while
                              tbl2.close()

                              what line has to be changed?
                              Is there a newer way of doing this?
                              Attached Files

                              Comment

                              Working...
                              X