3 Replies Latest reply on Nov 28, 2011 10:37 AM by philmodjunk

    Send E-Mail Script with Multiple E-mail Fields Not Working Properly

    TimWhitehead

      Title

      Send E-Mail Script with Multiple E-mail Fields Not Working Properly

      Post

      I'm a new Filemaker Pro user and I've created my database using the Contact Management starter solution.  I've created two e-mail fields, one for a Home Email, and one for a Work Email.  I also duplicated the default "Send Email" script button.  I would like to have each button send an e-mail to the appropriate email address, obviously one for the "Email_Home" field, and one work the "Email_Work" field. 

      I went into the script settings and changed the corresponding field from "Email_Home" to "Email_Work", however when I click the button next to the Work Email field, it opens up my email client and populates the To: field with the email address from the Home field.  Both of the buttons send an email from the Home field.  Any idea how to fix this?  Thanks

       

       

        • 1. Re: Send E-Mail Script with Multiple E-mail Fields Not Working Properly
          philmodjunk

          Do you have one script for both buttons or two scripts, one for the Email_Home and Email_Work fields?

          You'll either have to set up two different scripts so that you can specify different email fields in the send mail step or modify your buttons and scripts to pass the specified email address as a script parameter to the same script.

          • 2. Re: Send E-Mail Script with Multiple E-mail Fields Not Working Properly
            TimWhitehead

            Thanks for your reply. 

            I started with the Contact Mangement starter solution included in Filemaker 11.  There was a single button for a single e-mail field (Email_Home). I then created a second email field (Email_Work) and duplicated (Copy & Pasted) the button.  So there are two seperate email fields with two buttons.

            Obviously when I copy & pasted the button, the scripts were the same, but I attempted edit the script so it would be associated with Email_Work instead of Email_Home.  I went into the script mannually and changed everything that said "Email_Home" to "Email_Work", but for some reason it still associates itself with the home field.

            Any thoughts?  Do I need to delete and re-create the button from scratch? If so could someone post some instructions how to do so?  Thanks

            • 3. Re: Send E-Mail Script with Multiple E-mail Fields Not Working Properly
              philmodjunk

              And if you did change every reference to Email_Home to Email Work this would break your first button as now it will run this script and produce exactly the same results as the second button.

              Open Manage | Scripts. Find this script and use the duplicate button to make a new copy of this script. Edit it like you describe, but be sure to double-click the send mail step and change the field specified in the To: box.

              The original script refers to: Contact Management::Email Address with Name

              This is a special calculation field that combines the oribinal email address with the contact name to produce this format:

              Name_First & " " & Name_Last & " <" & Email & ">"

              If you want to include the contact name when using the new Email field, you'll need to creeate a new version of this calculation field that does the same, but with the new field so that you can refer to it in the Send Mail's "To" box.