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

Send_email error # 16040 and email will not be sent.

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

    Send_email error # 16040 and email will not be sent.

    I am getting this error in a send_email script:
    The report EmailGrpSubmission works, as the test.htm is created in the root.
    Any suggestions, or where to look?

    error sending message
    250.2.5.0 address ok.

    so I added the script for error:
    on error goto display_error
    -------
    script
    --------------
    end
    display_error:
    err = error_code_get()
    msg = error_text_get(err)
    ui_msg_box("Error", msg + str(err))
    end


    Now I get the error no: 16040 (Not in the wiki list of errors)

    I can send a single email using Alpha, with no problem.
    Here is the script in question:

    Dim tbl2 as P
    tbl2 = table.open("t_emaildata")
    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.Email)
    ' param_subject = " Confirmation"
    ' param_cc = ""
    ' param_bcc = ""
    ' param_msg = msg_text

    query.filter = "Rmaker = "+quote(tbl2.maker)
    query.order = "recno()"

    :Report.SaveAs("EmailGrpSubmission", "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, "Confirmation",message, "", "", "", .F., "HTML")
    tbl2.fetch_next()
    end while
    tbl2.close()

    #2
    Re: Send_email error # 16040 and email will not be sent.

    Just to add, that if I repeat the request, The error number is not repeated.
    I get 16063,16031,16033, 16003 and so on.

    Comment


      #3
      Re: Send_email error # 16040 and email will not be sent.

      Try sending the email in the interactive window and see what happens. Also, make sure that your profile is working properly. You can find that in A5 settings.

      Alternatively, try using Email_Send2() as that might work a bit better.

      Comment


        #4
        Re: Send_email error # 16040 and email will not be sent.

        Let me correct my first entry, Checkin closely I notice the error shows 250 2.5.0 address ok.
        no period bet 250 and 2
        Is that significant?

        Here is what I have done:

        email_send2(param_to, "Confirmation",message, "", "", "", .F., "HTML")
        got the error:
        Variable type mismatch attemp to pass 'c' to argument 'pMessage' is of type 'P' error 2026
        --------------------------------
        Using the following in interactive window worked:

        param_to = "[email protected]"
        message = "The green message"
        email_send(param_to, "Confirmation",message, "", "", "", .F., "HTML")

        param_to = "[email protected]"
        message = file.to_string("c:\test.htm")
        email_send(param_to, "Confirmation",message, "", "", "", .F., "HTML")

        I though that the report was the culprint but in the interactive windows, both worked and both messages including the results of test.htm were received.

        Any clue where I am wrong?
        Last edited by MikeData; 08-10-2014, 09:48 PM.

        Comment


          #5
          Re: Send_email error # 16040 and email will not be sent.

          Originally posted by MikeData View Post
          Here is what I have done:

          email_send2(param_to, "Confirmation",message, "", "", "", .F., "HTML")
          got the error:
          Variable type mismatch attemp to pass 'c' to argument 'pMessage' is of type 'P' error 2026
          --------------------------------
          Using the following in interactive window, both worked:

          param_to = "[email protected]"
          message = "The green message"
          email_send(param_to, "Confirmation",message, "", "", "", .F., "HTML")

          param_to = "[email protected]"
          message = file.to_string("c:\test.htm")
          email_send(param_to, "Confirmation",message, "", "", "", .F., "HTML")

          I though that the report was the culprint but in the interactive windows, both worked and both messages including the results of test.htm were received.

          Any clue where I am wrong?
          The arguments for email_send2() are different from email_send()

          Per the docs
          http://wiki.alphasoftware.com/~alpha...SEND2+Function
          Al Buchholz
          Bookwood Systems, LTD
          Weekly QReportBuilder Webinars Thursday 1 pm CST

          Occam's Razor - KISS
          Normalize till it hurts - De-normalize till it works.
          Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
          When we triage a problem it is much easier to read sample systems than to read a mind.
          "Make it as simple as possible, but not simpler."
          Albert Einstein

          http://www.iadn.com/images/media/iadn_member.png

          Comment


            #6
            Re: Send_email error # 16040 and email will not be sent.

            I have tried this script: The error is the same as above.

            Dim tbl2 as P
            tbl2 = table.open("t_emaildata")

            tbl2.fetch_first()
            dim I as N
            dim K as N
            dim J as N
            dim message as p

            while .not.tbl2.fetch_eof()
            query.filter = "Rmaker = "+quote(tbl2.maker)

            query.order = "recno()"
            :Report.SaveAs("EmailGrpSubmission", "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

            'body = file.to_string("c:\test.htm")
            body = " Great email. "
            message.message = body
            message.to = trim(tbl2.Email)
            message.subject = "Confirmation"

            email_send2(message, "", .F., .T.)

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

            Comment


              #7
              Re: Send_email error # 16040 and email will not be sent.

              Where are you using the script?

              If on a form, create a button and then use Action Scripting to create the code for you. Simple as that. Also, you can study the code generated.

              Comment


                #8
                Re: Send_email error # 16040 and email will not be sent.

                Mike,

                Your script saves each report to the same disk file over and over. I suspect you have a timing issue. Try using distinct filenames for each saved report.

                Comment


                  #9
                  Re: Send_email error # 16040 and email will not be sent.

                  First thanks to all for responding.

                  The script is used in a menu form. In other words abutton that call the script shown above.

                  I was thinking about it, but if it is timing, at least the first one email will be sent. Is it?.
                  Do this line should be changed? wait_until(.F., 5, 5)

                  Should we look at my settings in the profile, even though it sends the emails in the interactive and I can send and receive?

                  I am using thunderbird as my regular email.
                  Windows 7, 64b
                  In the profile I am using default with the access to my regular email and the test option, shows succeed plus it sends a test to the email address.

                  I did try not using a file name but naming the line message = file.to_string("c:\test.htm") to message = "Great email to enjoy"
                  In other words, removed the file naming issue.
                  Same results.

                  Comment


                    #10
                    Re: Send_email error # 16040 and email will not be sent.

                    I have checked the email profile (default) many times, even create one by name.
                    The setting are correct as it send emails every test after telling me, all is OK.
                    I Have changed the timing wait_until(.F., 5, 5) with many combinations, as high as 90,25 and even erasing it.
                    Same results.
                    I changed the default email system to Alpha email system, same results.
                    Tried the email_send() and email_send2(), same results.
                    Manually from the interactive windows, it sends the emails.

                    So why the error error sending message 250 2.5.0 address OK.
                    The error is confusing and why 250?
                    Where the 250 comes from? It is not mine
                    Is there any other way to do this task?
                    Any suggestions?
                    Hair is getting sporadic and I my age takes a looong time to regrow(hope).

                    Comment


                      #11
                      Re: Send_email error # 16040 and email will not be sent.

                      Google 250 2.5.0
                      Al Buchholz
                      Bookwood Systems, LTD
                      Weekly QReportBuilder Webinars Thursday 1 pm CST

                      Occam's Razor - KISS
                      Normalize till it hurts - De-normalize till it works.
                      Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                      When we triage a problem it is much easier to read sample systems than to read a mind.
                      "Make it as simple as possible, but not simpler."
                      Albert Einstein

                      http://www.iadn.com/images/media/iadn_member.png

                      Comment


                        #12
                        Re: Send_email error # 16040 and email will not be sent.

                        Good news, It has been resolved.
                        The table emaildata that contained the email address, must have been carring an extra period in the email address, so I reworked the process to make sure no extra period and now is sending emails perfectly with no extra .

                        What led me to look back in the table was that I changed the parm_to = "singleemail.com" not the table email address
                        in other words one email for all, disregarding the table.
                        All email were sent with no errors.
                        So the problem had to be with the email address in the table itself.

                        Thanks for helping all along.
                        I think I notice the tip of a new hair is growing.

                        Al, I did google 250 2.5.0 before, all I saw was nothing related, other than my posting itself.
                        Was there anything I miss?

                        Comment

                        Working...
                        X