5 Replies Latest reply on Aug 18, 2013 5:33 PM by carguybikeguy

    Send Mail Script Step (SMTP) launching mail client


      Hello all!

      I am scripting a few things for my file and one of them is to send a pdf as an attachment. Pretty routine and I have been working so far with using the mail client with some success. No surprise there as it seems to work very well. But my real issue is when specifying an SMTP server and filling in all the information, the device's mail client opens and tries to send the message. The funny thing is that the message does get sent from within the FileMaker solution just like I have it scripted. As soon as I dismiss the device client and tell it to cancel the sending of the message, I get the email I sent. So the Send Mail Script Step using the SMTP settings is working but for the fact it is opening the device's mail client.


      So is this a known bug or am I missing something so basic I need to go back to getting started classes?

        • 1. Re: Send Mail Script Step (SMTP) launching mail client

          If you use the "Send Mail" script step and select "SMTP Server", it will not open the mail application.  It talks directly to the SMTP server.  Make sure you don't have somewhere else in your script where it is sending using "E-mail Client" or confirm that you have selected "SMTP Server" in your "Send Mail" script step.  This is the normal behavior assuming you haven't done something on the OS side of things to capture outgoing SMTP email (e.g., maybe a virus scan setting or firewall filter, etc.).


          What OS are you using and what version of FM?  What is the email client?

          • 2. Re: Send Mail Script Step (SMTP) launching mail client

            I am using the SMTP server option in the Send Mail script step. Checked and double checked the settings. Not using anything like a software firewall or an antivirus software. The OS client for sending mail on the machine where I am currently working is not set up at all.


            The machine I am working from at the mooment is a standard Macbook with 10.6, using FileMaker Pro 12 Advanced. At work I use a current model MacBook Pro with 10.8 and the same software. I'll be able to see tomorrow if I encounter the same situation. On that Mac I have no antivirus set up either but I am making extensive use of the Mail client.


            Just for giggles, I'm attaching some screenshots of the script and the script step's setup dialog.

            Screen shot 2013-08-18 at 4.16.08 PM.png

            Screen shot 2013-08-18 at 4.16.22 PM.png

            • 3. Re: Send Mail Script Step (SMTP) launching mail client

              Are all of your SMTP settings correct?  Do they work on another machine?  Have you tried this on another Mac or a Windows computer?  I see you are going to do this in the morning when you get to work.  Let us know how it goes when you try it there. 

              • 4. Re: Send Mail Script Step (SMTP) launching mail client

                Will do. All the settings are correct as the email is sent with the PDF attached just as scripted. The email does go and is received from within the FileMaker environment. It's just that somewhere in the middle of it all, the mail client opens. By the way, it does this when performing the same action from an iOS device. The iPad or iPhone will bring up a new message window within the open FileMaker file. If I tap cancel and tell it to delete the draft (the functional equivalent to quitting the mail client on the Mac), I still get the message with the attachment as desired.

                • 5. Re: Send Mail Script Step (SMTP) launching mail client

                  I found the issue. When building the steps in the script, the script step for saving the record as PDF includes a little check box for "Create email with file as attachment." Knowing what I wanted to ultimately do, I checked that box thinking it necessary to the process. It turns out that box specifically tells the mail client on whatever system the user is on to open the mail client and attach the file. Editing the script and unchecking the box solved the issue.Screen shot 2013-08-18 at 5.33.21 PM.png