10 Replies Latest reply on Jun 18, 2015 1:54 AM by monkeybreadsoftware

    How to use Send Mail using multiple emails in the To: section

    doneonsite

      Hi guys,

       

      I have a solution that uses a send email script for sending emails on Filemaker Go13.

       

      I'm using a 'Set Variable' function to store the field from a table that has multiple emails seperated by ', '

       

      e.g  tba@tba.com, tba2@tba.com, tba3@tba.com

       

      Out of the 190 odd records I have, only 5 or so have up to 4 email addresses, mostly it's only one email address.

       

      When the script runs, it pulls the details fine, as I can see using Data Viewer, but will not paste into the 'To:' of the send mail script? It just leaves it blank.

       

      When I try on my mac, it's pasting the string, but has a ? in an orange circle at the beginning, if I click into the address, it shows that it has been pasted like this:

       

      <tba@tba.com, tba2@tba.com, tba3@tba.com>

       

      Any ideas, I can make multiple fields in the other table and store each email address in a seperate field, but would like to know what I'm missing from the above.

       

      Thanks

        • 1. Re: How to use Send Mail using multiple emails in the To: section
          keywords

          It looks as if the script is picking a single chevron at each end of the string of emails. You will need to remove this, probably by parsing your variable result using Substitute ( ).

          • 2. Re: How to use Send Mail using multiple emails in the To: section
            Mike_Mitchell

            We probably need a little more information about your calculation in order diagnose it correctly. Can you post a copy of your script?

            • 3. Re: How to use Send Mail using multiple emails in the To: section
              beverly

              hello! I'm not sure about "pasted". Are you putting the results into a variable and/or field and then using the variable/field in the dialog?

               

              Also with email, some client require a semi-colon ";" between values and some require a comma ",". See if that makes a difference.

               

              beverly

              On Jun 16, 2015, at 3:52 PM, doneonsite <noreply@filemaker.com> wrote

               

               

              How to use Send Mail using multiple emails in the To: section

              created by doneonsite in Discussions - View the full discussion

              Hi guys,

               

              I have a solution that uses a send email script for sending emails on Filemaker Go13.

               

              I'm using a 'Set Variable' function to store the field from a table that has multiple emails seperated by ', '

               

              e.g  tba@tba.com, tba2@tba.com, tba3@tba.com

               

              Out of the 190 odd records I have, only 5 or so have up to 4 email addresses, mostly it's only one email address.

               

              When the script runs, it pulls the details fine, as I can see using Data Viewer, but will not paste into the 'To:' of the send mail script? It just leaves it blank.

               

              When I try on my mac, it's pasting the string, but has a ? in an orange circle at the beginning, if I click into the address, it shows that it has been pasted like this:

               

              <tba@tba.com, tba2@tba.com, tba3@tba.com>

               

              Any ideas, I can make multiple fields in the other table and store each email address in a seperate field, but would like to know what I'm missing from the above.

               

              Thanks

              Reply to this message by replying to this email, or go to the message on FileMaker Community

              Start a new discussion in Discussions by email or at FileMaker Community

              Following Discussions in these streams: Connections Stream

              Manage your email preferences

               

              FileMaker Developer Conference 2015 • Las Vegas, Nevada • July 20-23 • www.filemaker.com/devcon

               

              • 4. Re: How to use Send Mail using multiple emails in the To: section
                Magnus Fransson

                doneonsite wrote:

                 

                Hi guys,

                 

                I have a solution that uses a send email script for sending emails on Filemaker Go13.

                 

                I'm using a 'Set Variable' function to store the field from a table that has multiple emails seperated by ', '

                 

                e.g  tba@tba.com, tba2@tba.com, tba3@tba.com

                 

                Out of the 190 odd records I have, only 5 or so have up to 4 email addresses, mostly it's only one email address.

                 

                When the script runs, it pulls the details fine, as I can see using Data Viewer, but will not paste into the 'To:' of the send mail script? It just leaves it blank.

                 

                When I try on my mac, it's pasting the string, but has a ? in an orange circle at the beginning, if I click into the address, it shows that it has been pasted like this:

                 

                <tba@tba.com, tba2@tba.com, tba3@tba.com>

                 

                Any ideas, I can make multiple fields in the other table and store each email address in a seperate field, but would like to know what I'm missing from the above.

                 

                Thanks

                Hi,

                 

                Modify your script/calculation to put something like this:

                 

                <tba@tba.com>, <tba2@tba.com>, <tba3@tba.com>

                 

                or this:

                 

                <tba@tba.com>; <tba2@tba.com>; <tba3@tba.com>

                 

                in the address field.

                That is, put the angle brackets (<>) there you self, and test with either coma (,) OR semi colon (;).

                 

                Best regards Magnus Fransson.

                • 5. Re: How to use Send Mail using multiple emails in the To: section
                  rrrichie

                  I use the list function in my scripts if mails are collected one by one :

                   

                  loop

                   

                    $mail_to = list ( $email ; $mail_to )

                   

                     exit loop if (tired of collecting e-mail addresses)

                   

                  end loop

                   

                  for records that have multiple mails in one field i use this... substitute ( field_with_email ; "," ; "¶" ).

                  • 6. Re: How to use Send Mail using multiple emails in the To: section
                    doneonsite

                    Hi guys,

                     

                    Sorry for delay getting back, appreciate all the responses.

                     

                    Simply using the ";" worked over the "," what is interesting though is when the emails are put in the To: section, they are seperated by a ",".

                     

                    Using <emailaddress> , <emailaddress> etc would only put one "," in the To: section.

                     

                    Using <emailaddress> ; <emailaddress> this also worked perfectly.

                     

                    Again thanks everyone for your feedback and ideas.

                    • 7. Re: How to use Send Mail using multiple emails in the To: section
                      doneonsite

                      Hi rrrichie,

                       

                      Love using Set Variable function, thanks for the idea.

                       

                      One question I do have is, why when mulitple mails are in one field do you substitute with "¶" and not ";" ?

                       

                      Regards


                      Scott

                      • 8. Re: How to use Send Mail using multiple emails in the To: section
                        beverly

                        Wonderful! I know when I had to test this once upon a time, I think there was no rhyme or reason (various mail apps, various platforms). Sometimes ";" is needed and sometimes ",". I've also seen the ";" change to "," once the list made it to the email client, so you need not worry!

                         

                        beverly

                        • 9. Re: How to use Send Mail using multiple emails in the To: section
                          rrrichie

                          Hi Scott,

                           

                            You're welcome :-)

                           

                             I use the ¶ cause list() works :-)

                           

                            The list separator is CR or ascii char 13.  In my opinion FileMaker uses the ¶ as a shorthand for char(13).  if you test for char(13) = ¶ you get true.

                           

                             Like Beverly said with ; and , your mileage may vary.  Probably has to do with the country settings...

                           

                            (off-topic) In the netherlands the , comma is used as a decimal point and so in "dutch" merge files the ; is used as a separator...so a csv (comma separated values) file is actually a ssv file :-)

                           

                          Happy Coding,

                          Ramon

                          • 10. Re: How to use Send Mail using multiple emails in the To: section
                            monkeybreadsoftware

                            Did you see MBS Plugin?

                            It can send multiple attachments and have multiple email addresses?

                            Example database included with plugin for sending emails.