9 Replies Latest reply on Aug 30, 2012 7:08 PM by marilouv

    Using IWP to send mail

    marilouv

      I have a small file set up to allow teachers to submit transportation requests for students using FM 11.

       

      Teachers logon via IWP and a new record is created. They enter information, and hit Submit. This is the script for Submit:

      Commit Record/Request [No dialog]

      Set Error Capture [On]

      Allow User Abort [On]

      Send Mail [Send via SMTP server; No dialog;...etc

      -"To" is a field where user fills in email address, using the school domain name

      -"Message" is a calculation field to the teacher with the details of the record

      Go to Layout ["Response"]

       

      At the next layout, a message is displayed saying the record has been submitted, and when the user clicks OK, they are logged off.

       

      I have another script, similar steps that allows a secretary to review the requests, and accept or reject them. If they are rejected, a rejection message goes to the teacher. If they are accepted, the teacher gets a confirmation, and the transportation dept. gets a calculation with all the information from the record.

       

      Sometimes, it works, sometimes it doesn't. I can go in as a teacher and create two records in a row, one will generate an email, the next one will not. When I go in as secretary, if I accept the record, sometimes the teacher gets a confirmation, but no email is sent to transportation.

       

      I have verified all the SMTP settings with my IT department (no encryption, no authentication, port 25).

       

      I called FileMaker, they told me that if any emails were sent at all, then it was not FM's fault, and they could not help.

       

      I am so frustrated. A system that sends records 50% of the time will not work.

       

      Any suggestions at all would be appreciated.

        • 1. Re: Using IWP to send mail
          BowdenData

          Hi,

           

          I suggest that you track the sending of the emails. Right after your Send Mail step, insert an error capture. Something like the following in psuedo code:

           

          Send Mail

          Set Variable $lastError to Get( LastError )

          Set Field emailStatus to $lastError

          If $lastError ≠ 0   //the send email generated an error

            do some appropriate action...

          Else

            Goto layout Response

          End If

           

          In the script steps above, I am assuming you have a field (I called it emailStatus) in your table for storing the status code of the send email operation.  The other thing you should have in your table, are a couple of standard "auditing" type fields that capture the record creation timestamp and the record modification timestamp. I would also recommend capturing the account name of the record creator and record modifier.

           

          This will allow you to see what is going on so you can present some facts/statistics to the IT department if needed.

           

          In the FM Help for error codes, the last ones 1501 through 1507, all deal with email. Error code 1506 is the most generic one and the one most likely to happen. This tells you that FM attempted to pass the email to the server, but the server rejected it.

           

          You can then go to your IT and show them the exact date and time when emails are getting rejected. They should be able to look in their email server log files and see that the server received a request and so forth.

           

          One other thing to verify is the information you are submitting to the SMTP server. Is the information consistent? By that I mean that for each record submitted, you have valid values in the TO field and other fields. If you are exposing some other fields such as the From, Reply To, etc., then this has to be checked. Some mail servers are quite picky about values in these other fields or even having a value at all.

           

          HTH.

           

          Doug

          • 2. Re: Using IWP to send mail
            pthomas

            I had a very similar issue a while ago with e-mails sometimes working and sometimes not.

             

            The errors that FileMaker were returning weren't particularly useful so I decided to remove FileMaker from the equation and I used telnet (I think) to connect to the SMTP server directly and issue commands.

             

            I was able to see from that testing that the connection to the SMTP server was very unstable, often the commands I would issue via telnet would time out which was proof enough to me that there was no issue with FileMaker and it was in fact the SMTP server and/or the network that were the problem!

             

            In the first instance I would work with your IT department to confirm the quality of the connection to the SMTP server from your FileMaker server.

            • 3. Re: Using IWP to send mail
              marilouv

              I did as you suggested, and added the script steps you outlined. Now I can gather data. I didn't know how to do this, and feel like at least now I might have a clue what to look for. The best part of this, is that my IWP users will now be notified that their information has not been sent. If $lastError 0,  I send them to another layout that gives them the option of going back, checking to make sure that say, the email address they entered was formatted correctly, and then try again.

               

              I'm going to try to get a group of teachers to "test" it for a few days, then I'll report back.

               

              Many thanks!

              • 4. Re: Using IWP to send mail
                marilouv

                Thanks for your response. I am afraid my level of expertise would not include doing what you did, and I don't think my IT department would grant me that level of access, but I am curious. When you determined that the issue was the instability of the connection, were you able to get it resolved?

                 

                Sometimes talking with my IT guys just leaves me more confused than I was before!

                • 5. Re: Using IWP to send mail
                  pthomas

                  As it turns out by the time I had discovered where the problem was we were just about to move to a new network infrastructure that included a different SMTP server that didn't have the same problems.

                   

                  So no sorry I didn't get it resolved, we were fortunate enough to side-step the problem!

                   

                  However the fact that the new SMTP server was stable just confirms that it was the old SMTP server/network infrastructure that was the problem!

                   

                  I would be pushing back onto your IT department for some extra support and help troubleshooting the issue!

                   

                  I hope you have better luck getting your issue solved!

                   

                  Cheers,

                   

                  Paul.

                  • 6. Re: Using IWP to send mail
                    marilouv

                    Update: this is working beautifully! I changed a few things. I added a new table for errors, and told the script to create a new record everytime an error is generated. this gives me a nice layout with the timestamp, record ID and the error code in a list view. Very helpful to me and to the tech guys. I have found several errors that I assumed were  erver errors, and in fact were due to other things within my control. Having very specific data seems to get their attention to the issue, and I think we are well on the way to getting some answers.

                     

                    Thank you for helping me to look at this in a different way.

                    • 7. Re: Using IWP to send mail
                      CarstenLevin

                      I believe that the suggestions you got where both usefull and did set you on in a good direction.

                       

                      Let me suggest that you also do this to give better overview and debugging:

                      1. Create an extra email address/mailbox for your domain.
                      2. Send all mails bcc to this adress.
                      3. Create a log entry in the database (as you are doing now, if I understand the comments correct) for each mail that should have been sent.

                       

                      Now compare your bcc email box with your log. They should matc each other.

                       

                       

                      ... I am of course assuming that you are testing that the person entering data can not submit without entering his/her email address?

                       

                      Best regards

                       

                      Carsten

                      • 8. Re: Using IWP to send mail
                        marilouv

                        Yes, I have been doing both of those things. I hope to stop copying myself at some point when I get some consistency.

                         

                        Thanks for your suggestions.

                        • 9. Re: Using IWP to send mail
                          marilouv

                          Update: I wish I could tell you what the IT guys did, but emailing seems to be quite consistent now. One very important thing that I learned is that in my case, very few emails go through when I am accessing the database remotely, but they are now consistently being sent throught IWP. I am not sure why this would be but since my users will all be on IWP, I can live with it, and I need to move on.

                           

                          Thanks to all who offered help and suggestions!