7 Replies Latest reply on Mar 21, 2012 9:00 AM by carlsson_1

    Send mail with SMTP and IWP

    carlsson_1

      Title

      Send mail with SMTP and IWP

      Your post

      I have an IWP solution hosted on a FM 10 server advanced.

      One of the functions is to send an email from the solution, with the help of SMTP settings. This works when I do it from a FM client, but not from IWP.

      It's hard to troubleshoot this as well, since you don't have the Script Debugger in the browser.

       

      Any ideas?

        • 1. Re: Send mail with SMTP and IWP
          dbail22@comcast.net

          In the script editor select the option to show server compatible steps.  If ANY steps in the script are not compatible, FM ends that script without warning. 

          • 2. Re: Send mail with SMTP and IWP
            carlsson_1

            dbail, the send mail with SMTP is allowed with IWP. As a matter of fact, it's the only way to send mai with IWP.

            • 3. Re: Send mail with SMTP and IWP
              dbail22@comcast.net

              I am not commenting on that particular step.  Filemaker has a bad tendency to exit the whole script if only ONE of the steps in the script is not compatible. For instance if you included the step "Flush Cache to Disk" (which is not server compatable) the script could fail completely, not just that one step.

              • 4. Re: Send mail with SMTP and IWP
                carlsson_1

                Understood, good point. 

                However, I am testing with a script containing only the Send mail step. Works in FM, not in IWP.

                ??

                • 5. Re: Send mail with SMTP and IWP
                  dbail22@comcast.net

                  There are more gotchas in the server running scripts.  It appears that if a scheduled script starts to run the Server "Logs In".  Or at least partially.   It uses the permissions you set when you setup the script on the server console but for a user name it uses the name of the script.  So if you scheduled a script to run titled "My Script", the user name reported when running is "My Script" not the user name who's permissions you used. 

                  The server also runs any startup script you have set for the file that contains the script and any logoff script that is set.  Check the log viewer in the Server.  You may find the problem is a step in the startup script.  Why a script would fail this way I don't know but after setting two different scripts to run by the server, and they failed I found a simple "Freeze Window" step caused the failure.  At least eliminating that step in the startup script solved the problem for me.

                   

                  BUT

                  I also still have a problem attaching a file with a script.  When run from a client it sends the email and attaches the file.  When it runs as a scheduled server script it sends the email but will not attach the file no matter where I locate the file.

                  Any ideas Filemaker???

                  • 6. Re: Send mail with SMTP and IWP
                    carlsson_1

                    My problem is not with a scheduled script. However, turning on logging is a good idea!

                    • 7. Re: Send mail with SMTP and IWP
                      carlsson_1

                      I have looked at the log, and I don't understand a thing.

                       

                      Here is the result from the log when I press the button, that *only* makes a Send Mail-step:

                      2012-03-21 16:53:25     Web Server     Information     wpc fm.4633.se 0.152622
                      2012-03-21 16:53:25     Web Publishing Core     Information     213.88.134.194:0 - - "/fmi/iwp/cgi?-index=92&-recid=14754&-relatedrecid=14754&-buttonscript=" 200 54008
                      2012-03-21 16:53:26     Web Server     Information     wpc fm.4633.se 0.003178
                      2012-03-21 16:53:26     Web Server     Information     wpc fm.4633.se 0.003558
                      2012-03-21 16:53:26     Web Server     Information     wpc fm.4633.se 0.004217
                      2012-03-21 16:53:26     Web Server     Information     wpc fm.4633.se 0.005565
                      2012-03-21 16:53:26     Web Server     Information     wpc fm.4633.se 0.003768
                      2012-03-21 16:53:26     Web Server     Information     wpc fm.4633.se 0.005037
                      2012-03-21 16:53:26     Web Server     Information     wpc fm.4633.se 0.003113
                      2012-03-21 16:53:26     Web Server     Information     wpc fm.4633.se 0.004618
                      2012-03-21 16:53:26     Web Server     Information     wpc fm.4633.se 0.003860
                      2012-03-21 16:53:26     Web Server     Information     wpc fm.4633.se 0.005423
                      2012-03-21 16:53:26     Web Server     Information     wpc fm.4633.se 0.005551
                      2012-03-21 16:53:26     Web Server     Information     wpc fm.4633.se 0.006953
                      2012-03-21 16:53:26     Web Publishing Core     Information     213.88.134.194:0 - - "/fmi/iwp/res/iwp.css" 200 7942
                      2012-03-21 16:53:26     Web Publishing Core     Information     213.88.134.194:0 - - "/fmi/iwp/res/iwp.js" 200 2490
                      2012-03-21 16:53:26     Web Publishing Core     Information     213.88.134.194:0 - - "/fmi/iwp/data.jpg?-containerlayobj&-lay=5&-index=0" 200 774
                      2012-03-21 16:53:26     Web Publishing Core     Information     213.88.134.194:0 - - "/fmi/iwp/data.jpg?-containerfield&-recid=14754&-field=76(1).1" 200 12828
                      2012-03-21 16:53:26     Web Publishing Core     Information     213.88.134.194:0 - - "/fmi/iwp/data.jpg?-containerfield&-recid=14754&-field=76(1).13" 200 21190
                      2012-03-21 16:53:26     Web Publishing Core     Information     213.88.134.194:0 - - "/fmi/iwp/data.jpg?-containerfield&-recid=14754&-field=76(1).86" 200 17944
                      2012-03-21 16:53:26     Web Publishing Core     Information     213.88.134.194:0 - - "/fmi/iwp/data.jpg?-containerlayobj&-lay=5&-index=42" 200 774
                      2012-03-21 16:53:26     Web Publishing Core     Information     213.88.134.194:0 - - "/fmi/iwp/data.jpg?-containerlayobj&-lay=5&-index=49" 200 3076
                      2012-03-21 16:53:26     Web Publishing Core     Information     213.88.134.194:0 - - "/fmi/iwp/data.jpg?-containerfield&-recid=14754&-field=76(1).2" 200 34744
                      2012-03-21 16:53:26     Web Publishing Core     Information     213.88.134.194:0 - - "/fmi/iwp/data.jpg?-containerfield&-recid=14754&-field=76(1).49" 200 78820
                      2012-03-21 16:53:26     Web Publishing Core     Information     213.88.134.194:0 - - "/fmi/iwp/data.jpg?-containerfield&-recid=14754&-field=76(1).14" 200 19653
                      2012-03-21 16:53:26     Web Publishing Core     Information     213.88.134.194:0 - - "/fmi/iwp/data.jpg?-containerfield&-recid=14754&-field=76(1).7" 200 25289

                      Any takers?

                       

                      PS. I have tried this on two different servers now, one with FM10SA and one with FM11SA (the above is from v11). DS