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

Switching focus to email client when calling Letter.Send()

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

    Switching focus to email client when calling Letter.Send()

    I'm stuck on this and hope someone can suggest a solution...

    I'm using Letter.Send() to email a PDF using my default MAPI email client (which happens to be "The Bat!").

    Everything works great except that when the Send Email Message window is created by the email client, focus stays on the Alpha form window that created it rather than switching to the new message's window. The Send Email Message window's icon in the task bar blinks, showing that it wants focus, but focus does not switch.

    I first tried sys_focus_put() after the call to Letter.Send() but of course Letter.Send() doesn't return until the email message has been sent and the window is gone.

    There are undocumented arguments to Letter.Send(). Could one of those help here?

    Is there possibly a way to manually do what Letter.Send() does, giving me a place to put a sys_focus_put() call? The only way I can find to do this is with email_client_external() which fails the same way.

    I also don't know if the problem is with Alpha or the email client itself.

    I've spent a day fighting with this and I can't be sure it's not just a dumb mistake on my part. I also think I remember this working properly in the distant past. Any help would be much appreciated...

    -jimc

    #2
    Re: Switching focus to email client when calling Letter.Send()

    What happens if you set Windows Live Mail as the default client?
    Or Outlook etc.
    Also, what happens when you use the Alpha client?
    I'm not familiar with the bat, so is it web based?

    Edit.
    Just read the Features list. I doubt this will work due to the configuration and security algorithms.
    See our Hybrid Option here;
    https://hybridapps.example-software.com/


    Apologies to anyone I haven't managed to upset yet.
    You are held in a queue and I will get to you soon.

    Comment


      #3
      Re: Switching focus to email client when calling Letter.Send()

      take a look at email_smtp_open() in alphapedia and the example that follows.
      see if you can use that example as a stepping stone to go further, along with email_smtp_send, email_smtp_close()
      with xbasic code you may be able to send directly to the server without going thru the bat window.
      just a thought, I do not have "the bat" or intention of getting.

      here is a script sending email from alpha without going to gmail.
      Code:
      dim ps as p
      dim pm as p
      pm.to = "my_email"
      pm.from = "my_email"
      pm.subject = "test email"
      pm.message = "this is a test message"
      pm.attachments = "my_documents_absolute_path_from_c:"
      
      dim result as l
      result = email_smtp_open(ps,"smtp.gmail.com",465,"my_user_name","my_password","SSL")
      if result
      	email_smtp_send(pm,ps)
      	msgbox("Success","email was sent")
      	else
      	msgbox("Failure","email was not sent")
      	end if
      email_smtp_close(ps)
      you should be able to do the same.
      Last edited by GGandhi; 04-21-2014, 09:05 AM.
      thanks for reading

      gandhi

      version 11 3381 - 4096
      mysql backend
      http://www.alphawebprogramming.blogspot.com
      [email protected]
      Skype:[email protected]
      1 914 924 5171

      Comment


        #4
        Re: Switching focus to email client when calling Letter.Send()

        Nice Govindan,
        I too would avoid something like Bat!, I am very suspicious about stuff like that.
        See our Hybrid Option here;
        https://hybridapps.example-software.com/


        Apologies to anyone I haven't managed to upset yet.
        You are held in a queue and I will get to you soon.

        Comment


          #5
          Re: Switching focus to email client when calling Letter.Send()

          thanks ted,
          it is really rewarding to get compliments from you.
          feels good.
          thanks for reading

          gandhi

          version 11 3381 - 4096
          mysql backend
          http://www.alphawebprogramming.blogspot.com
          [email protected]
          Skype:[email protected]
          1 914 924 5171

          Comment


            #6
            Re: Switching focus to email client when calling Letter.Send()

            I went through most of the hoops with the email stuff when I built my auto registration process for AS deployment and license keys, so easy, it isn't. Well not until you succeed that is then you ask yourself if you still have the brains you were born with!
            See our Hybrid Option here;
            https://hybridapps.example-software.com/


            Apologies to anyone I haven't managed to upset yet.
            You are held in a queue and I will get to you soon.

            Comment


              #7
              Re: Switching focus to email client when calling Letter.Send()

              Thanks for all the help.

              FYI, The Bat! \, while not well-known, is a well-respected email client and has been around for a long time. I've used it for many years and it has not failed me once. It has a lot of options and can be confusing to new users (though I've had good luck switching my clients to it after the demise of Outlook Express). It's forte is mailing lists and scripted responses. I understand (and practice) avoiding the unknown, but it's worth a look if you have the need.

              I kept at it last night and came to the conclusion that my problem was with Windows itself. The "Send Email Message" window was getting focus, but Windows was not making it the top-most window as it should. I did a bunch of Googling and found a few people with similar problems, using a wide variety of programs. There were two solutions that seemed to work for people, one being a change to the registry and the other simply powering down the computer for a few minutes.

              The registry key is in HKCU\Control Panel\Desktop and is called ForegroundLockTimeout. It needs to be added if missing (DWORD), or set to zero if nonzero. Mine was already set to zero so that wasn't the problem.

              So I went for the voodoo solution of powering off the machine for a minute then rebooting (I'd already tried just rebooting and it didn't help). But powering off "fixed" the problem. Maybe there is some uninitialized variable being used somewhere and powering off changes what it is set to -- I have no idea. The solution is very unsatisfying but the problem is gone, for the time being at least.

              Now the user can click on "Send Email" and The Bat!'s "Send Email Message" screen comes up with everything filled out and a PDF invoice attached, and the user can look it over then click "Send" and it's done. A copy (including the PDF) ends up in the "Sent Mail" folder. It's all very slick, and was so easy to do that it only took a couple of lines of Action Script.

              I've given a bunch of detail about this in case somebody else runs into the same problem in the future.

              Thanks again for the suggestions. Yes, installing another email client would have been my next step if the voodoo didn't work, but thankfully it has not been necessary (yet).

              -jimc

              Comment


                #8
                Re: Switching focus to email client when calling Letter.Send()

                Thanks for posting the solution.
                It will be interesting to see how long it lasts with good old MS Updates!
                See our Hybrid Option here;
                https://hybridapps.example-software.com/


                Apologies to anyone I haven't managed to upset yet.
                You are held in a queue and I will get to you soon.

                Comment

                Working...
                X