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

Grid won't send email with Office365 account, but works fine with a Gmail account.

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

    Grid won't send email with Office365 account, but works fine with a Gmail account.

    I have a situation that is driving me crazy. I built a small grid that is used by police dispatchers to send short, quick notifications to the police command staff via email and SMS text messages. When I first created it I used the SMTP settings of simple Gmail account that I created specifically for this purpose, and it works perfectly.

    But my bosses want me to use a "more professional" Office365 department email address, so I had our vendor create a new account called "[email protected]." I used all of the published SMTP settings for Office365 but it will not send anything. I tried with with the regular password and with an "app password," but still no sending. I also made sure that MFA is turned off, so that shouldn't be an issue.

    Plus, I tested the SMTP credentials in Alpha's built-in email program, and it works fine with the Office365 settings, it just won't work when clicking the submit button on the app as part of the AfterInsertRecord function.

    Here's the script in the grid which does NOT work:

    function AfterInsertRecord as a (e as p)

    dim pm as p
    dim ps as p

    if (email_smtp_open(ps, "smtp.office365.com", 587, "[email protected]", "***********","TLS")) then
    pm.to ="[email protected],"
    pm.from = "HCPD ALERTS"
    pm.Subject = "HCPD Notification"
    pm.Message = e.datasubmitted.message + " / " + "Duty Supervisor: "+ e.datasubmitted.Duty_Supervisor +" / "+ "Dispatcher: "+e.datasubmitted.Dispatcher
    result = email_smtp_send(pm, ps)
    end if
    email_smtp_close(ps)

    end function




    And here is the script that DOES work:

    function AfterInsertRecord as a (e as p)

    dim pm as p
    dim ps as p

    if (email_smtp_open(ps, "smtp.gmail.com", 587, "[email protected]","************","TLS")) then
    pm.to ="[email protected]"
    pm.from = "HCPD ALERTS"
    pm.Subject = "HCPD Notification"
    pm.Message = e.datasubmitted.message + " / " + "Duty Supervisor: "+ e.datasubmitted.Duty_Supervisor +" / "+ "Dispatcher: "+e.datasubmitted.Dispatcher
    result = email_smtp_send(pm, ps)
    end if
    email_smtp_close(ps)

    end function



    And as I said, I tested the Office365 settings and creds in Alpha's own email client, and it works fine:
    Screen Shot 01-18-22 at 04.38 PM 001.jpg

    Screen Shot 01-18-22 at 04.46 PM.jpg


    Obviously I have the SMTP settings correct so why won't it send??


    Attached Files
    Sergeant Richard Hartnett
    Hyattsville City Police Department
    Maryland

    #2
    Do you have the extra settings required by microsoft to make it work ?
    Gregg
    https://paiza.io is a great site to test and share sql code

    Comment


      #3
      I'm not sure what you mean by "extra settings," so maybe I don't. Can you elaborate?
      Thanks
      Sergeant Richard Hartnett
      Hyattsville City Police Department
      Maryland

      Comment


        #4
        Sorry about the delay.
        I used option 2 from this link https://docs.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-microsoft-365-or-office-365.
        Let me know if you need more help.

        2022-01-19_11-14-13.png
        Gregg
        https://paiza.io is a great site to test and share sql code

        Comment


          #5
          If you put the settings in the server profiles and it appears to work, then why don't you use the email profile to send the email?

          Instead of using smtp_open/send switch to email_send2 and use the email profile saved on the server.

          email_send2(pm, "MSOFFICE" ...)

          Worth a try anyway.

          If that doesn't work, then the next question would be:

          is the email failing to send or is the email getting blocked along the way.

          You don't appear to be checking the result code. Is it false or does Alpha think it's getting sent, but then MS stops it somewhere along the way.
          Last edited by lgrupido; 01-19-2022, 03:46 PM.

          Comment


            #6
            Here is an image of most of the data I track when sending email via one of my functions.
            I left out a few (primary key, ip addresses, and the order number), but I think it gives the general idea.
            I'll give a better display once my memory kicks in while looking for something else.
            Capture.png
            Attached Files
            Gregg
            https://paiza.io is a great site to test and share sql code

            Comment


              #7
              Pretty much the same data, but in the grid from my adminUtil project.

              2022-01-19_16-18-27.png
              Last edited by madtowng; 01-19-2022, 06:32 PM.
              Gregg
              https://paiza.io is a great site to test and share sql code

              Comment


                #8
                Ingrupido I'm not sure what you mean by "If you put the settings in the server profiles and it appears to work, then why don't you use the email profile to send the email?" This is where I was testing the settings:
                (And when I test the settings in here it will send email just fine, but this section doesn't help me with sending it as part of the grid submission, or am I missing something?)

                Screen Shot 01-19-22 at 05.32 PM.jpg
                Attached Files
                Sergeant Richard Hartnett
                Hyattsville City Police Department
                Maryland

                Comment


                  #9
                  Madtowng that is awesome. How did you get that information?
                  Sergeant Richard Hartnett
                  Hyattsville City Police Department
                  Maryland

                  Comment


                    #10
                    Most of it is returned when you execute the email_smtp_send() function.
                    If you show me that you a properly configured office365 account (as showing in post#4), I'll help you get it all functional.
                    If you want, I have an option for you to save the credentials to an encrypted file, and then you can import that file, ensuring
                    someone won't get the creds simply by using the code.

                    Gregg
                    https://paiza.io is a great site to test and share sql code

                    Comment


                      #11
                      Madtowng,
                      I will send you a private message.
                      Sergeant Richard Hartnett
                      Hyattsville City Police Department
                      Maryland

                      Comment


                        #12
                        send it to me as well
                        Insanity: doing the same thing over and over again and expecting different results.
                        Albert Einstein, (attributed)
                        US (German-born) physicist (1879 - 1955)

                        Comment


                          #13
                          In an earlier post, you tested what you called "Alphas Email Settings".

                          You can save those settings on the server. (Right click the server, go to email settings.)

                          Give the profile a name, then reference that name in email_send2.

                          That should use Alpha's email server to send the email for you through outlook.

                          Comment


                            #14
                            Originally posted by peteconway View Post
                            send it to me as well
                            Just in case it got lost in space or your junk folder, I sent the functions.
                            Gregg
                            https://paiza.io is a great site to test and share sql code

                            Comment


                              #15
                              Thanks will take a look.
                              Pete
                              Insanity: doing the same thing over and over again and expecting different results.
                              Albert Einstein, (attributed)
                              US (German-born) physicist (1879 - 1955)

                              Comment

                              Working...
                              X