7 Replies Latest reply on Nov 12, 2009 8:55 AM by alan.kirtlink

    Error 1506 when using Send Mail script step with an SMTP server

    alan.kirtlink

      Summary

      Error 1506 when using Send Mail script step with an SMTP server

      Description of the issue

      FileMaker Product(s) involved:FileMaker Pro 10.0v3Operating System(s) involved:Mac 10.5.8Haven't tested on WindowsDetailed description of the issue: I was trying to use the Send Mail script step in FMP 10 with an SMTP server and I kept receiving an error 1506.  I verified that all the SMTP settings were correct and tested with different servers and email addresses. Exact steps to reproduce the issue:1.  Create a database2.  Create a script that contains the Send Mail step.  Select SMTP Server in the Send via pop-up.  Hard code in values for the following: SMTP Server  Name Email Address Reply-To Address Outgoing SMTP Server Port = 25 Leave Use Secure Socket Layers unchecked Authentication = None  Main Send Mail dialog  To Subject MessageExpected Result:Email sent via the SMTP server Actual Result:Receive a 1506 errorAny workarounds that you have found:Removing the value from the "Name" field in the SMTP Server settings fixes the problem.

        • 1. Re: Error 1506 when using Send Mail script step with an SMTP server
          TSGal

          kirtlink:

           

          Thank you for your post.

           

          Certain mail servers tend to exhibit this behavior (gmail is definitely known), but we have been unable to duplicate the problem in house.  I send emails via SMTP with names through our mail server, and I have not encountered an error.

           

          Do you have access to another mail server?  If you are at a company, do they have more than one mail server?  If so, can you test on the other mail server?  If it works, can you find out the difference between the two servers?

           

          Any additional information you can provide may be helpful in narrowing down this issue.

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Error 1506 when using Send Mail script step with an SMTP server
            alan.kirtlink
              

            TSGal:

             

            I first saw the problem when trying to use our customer's mail server which I believe is on a Lotus Notes server.  I next tested it using my personal email which I believe would have been using SendMail.  Another developer at our company mentioned that he had had the same problem with our in house email server which is an Exchange server running on MS Small Business Server 2003.

             

            May I ask what your in house email server is?

            • 3. Re: Error 1506 when using Send Mail script step with an SMTP server
              TSGal

              kirtlink:

               

              OUr mail server is a generic SMTP mail server running on Mac OS X Server.

               

              I would check the Exchange server event logs to see where the problem occurs.  It could be authentication.  That is something you'll need to research.

               

              TSGal

              FileMaker, Inc. 

              • 4. Re: Error 1506 when using Send Mail script step with an SMTP server
                LeeLukehart
                  

                Relatedly, a similar cause of error 1506 is due to the format of the email address given to the To: parameter, when you try to include the recipient’s name along with the address. Specifically, it cannot be in the most common form that includes the full recipient name by using angle brackets around the email address: Full Name <account@domain.com>=BAD. To include both name and address, use the alternative form that places parentheses around the name, as so: account@domain.com (Full Name)=GOOD.  This will send both name and address when using the Send via E-mail Client option, and won’t trigger an error when using Send via SMTP.

                 

                Added 11/11/2009:


                Let me correct a misdirection and add some clarity around FileMaker Pro’s Send Mail functionality, and the SMTP process in general. While the above fix will work as described, it doesn’t properly explain why. And it wasn’t the whole story, because the FullName portion of an email such as “account@domain.com (FullName)” is not used by the Send via SMTP option. So below I expand my description of the cause and note one potentially limiting effect.

                 

                First, the ‘Send via SMTP’ option of the Send Mail command (and script step) expects only an email address (e.g. account@domain.com) as a value for the To: parameter. This is different than the To: field in an email client application (such as MS Outlook or Apple Mail), where a name can be entered along with the email address, usually in either of the two formats described above (with brackets or parentheses). The distinction is meaningful to this discussion because the two methods interact differently with SMTP mail servers.

                 

                When using the Send via SMTP option, any data in the To: other than the actual email address is superfluous to the SMTP server and usually is stripped out. Except for the angle brackets, which were required to delimit an email address in the original SMTP specification. This is why most mail client apps and middleware (PHP, Perl, etc.) functions will automatically add the brackets behind the scenes, if interpreted as missing. So another pair of brackets may be getting wrapped around your To: value, giving SMTP mail servers cause to reject the address and return an error.Herein lies the caveat: we lose the ability to include a recipient’s name when we use FileMaker Pro’s Send via SMTP option. Now this really isn’t a major loss… people usually don’t display the To: column of their inbox. And since we’re not using an email client to send the message, we have no outbox in which to display a To: column.

                 

                Herein lies the caveat: we lose the ability to include a recipient’s name when we use FileMaker Pro’s Send via SMTP option. Now this really isn’t a major loss… people usually don’t display the To: column of their inbox. And since we’re not using an email client to send the message, we have no outbox in which to display a To: column.

                 

                One positive that I didn’t mention before:  It may not be obvious that the To: parameter may contain multiple email addresses, separated by semi-colon or carriage returns.


                 

                Also, to help find successful combinations of SMTP Send Mail parameters, you may find the following file useful: SMTP_SendMail_Interrogation.fp7 . Essentially it contains a single script that attempts to send email using every variation of the settings you give it (SSL on/off, auth type, port #s, etc.).

                 

                Hope this helps others looking for a 1506 fix!

                • 5. Re: Error 1506 when using Send Mail script step with an SMTP server
                  SteveEikos
                    

                  I am getting the same issues with our Lotus Notes generic E-Mail server.

                  What I find odd though is that I can get errors and warnings E-Mailed to me by my FM 10 Adv. server but

                  cannot send an E-Mail via a script Send E-Mail step.

                   

                  Also, How is the E-Mail sent, if I have a hosted DB and access it and send E-Mail is that only sent from my local

                  machine or from the server? Do I need to run a Scheduled script fromt eh server to send E-Mail directly from the Server?

                  I have tried both with no success to date.

                   

                  Hope the development boys are all over this. I would be happy to test any fixes to provide and information that woudl be

                  helpful in resolving this isse.

                   

                  Steve Eikos

                  • 6. Re: Error 1506 when using Send Mail script step with an SMTP server
                    TSGal

                    Steve Eikos:

                     

                    Thank you for your post.

                     

                    If you have a hosted database, the E-Mail is sent over the network to the SMTP server.  If you used an Email client, then the email would be sent via the local client.

                     

                    In FileMaker Pro, pull down the File menu and select "Send Mail...".  Enter the settings from the SMTP Server and send an email to yourself.  Does this work?  If not, then check with your mail server administrator for the right information to send.  Ask them to look at the mail server logs to see if they are receiving anything at the server, and if so, what stopped the server from sending the file.  Unfortunately, I am not familiar with Lotus Notes E-Mail server.

                     

                    Yes, you should be able to create a schedule in FileMaker Server that executes a Send Mail script.

                     

                    Please provide any additional information so I can replicate the problem.

                     

                    TSGal

                    FileMaker, Inc.

                    • 7. Re: Error 1506 when using Send Mail script step with an SMTP server
                      alan.kirtlink
                        

                      Steve,

                       

                      The reason error messages and warnings sent from the server are not effected by this problem may be that there is no "Name" field to fill in when you're entering SMTP server settings for email notifications in the FMS admin console.  All you enter is a "From Address" and a "Reply-To Address".

                       

                      It's filling in the "Name" field in the "SMTP Options" dialog of the "Send Mail" script step that causes the problem.  If you leave that field blank and only fill in "E-Mail Address" and "Reply-To Address" you shouldn't get that error no matter what type of mail server you're sending through.