7 Replies Latest reply on Jul 31, 2015 8:24 AM by KimWilkinson

    Sending email from individual users?

    KimWilkinson

      Title

      Sending email from individual users?

      Post

      Hello, I'm using FM12 and would like to set up a button, if pressed would look up the current user's email address  (for the reply to field) and send an email to me, the creator.  i have a table with users details (name, email, privilege set) but cannot figure out to to do this.  Any ideas?

        • 1. Re: Sending email from individual users?
          GuyStevens

          In the Users table you could add the user name. This is the name that user uses to log in to the Filemaker file.

          When users want to send you an email their username can be entered into a field. Then a relationship between that field with the username and the users table, username field can give you that users record as s related record. In that related table you can now get the email address of the current user.

          Another way is a "Freeze Window' script step, followed by going to the Users table and doing a find on the current Username. This also requires a field with the username. Then setting this users email address as a variable and returning to your original layout to send an email.

          • 2. Re: Sending email from individual users?
            philmodjunk

            Another way to answer this:

            There are many ways to do what you want. The best/simplest method requires knowing what tables/records/relationships you have in place at the time this button is clicked. If Guy's excellent advice isn't enough for you to get this working, please feel free to use Post a New Answer to post a more detailed description of your database.

            • 3. Re: Sending email from individual users?
              KimWilkinson

              Thanks for the response!  More details, I have a table that has:

              UserName

              UserEmail

              UserPrivilegeSet

              I want to press a button on my home screen that would go to this layout, find the current user's record, pull their email and send me an email.

              This is the script I have (sorry can't cut and paste hence the screen shot):

               

              • 4. Re: Sending email from individual users?
                philmodjunk

                I don't think you need anything but SendMail here unless you set up a record to store YOUR email address.

                Since this email is being sent to you, the TO address will be the same for all users. The return address will be added automatically just as if you manually used an email program to send out the email.

                Thus, a single Send Mail script step should be all that you need unless you wan the system to look up your address so that you can change your email address without having to update the script.

                • 5. Re: Sending email from individual users?
                  KimWilkinson

                  Oh, I think I was making this more complicated that it needed to be...I have it set up so that each user logs on with their username and password anyways.  I wasn't sure that if a user sent me an email that it would know that it came from them without a step telling filemaker who was sending the email?

                  • 6. Re: Sending email from individual users?
                    philmodjunk

                    FileMaker uses either an SMTP email server or the user's local email client program to send out email. It just sends the needed data to that software to generate and send the email. So return email addresses will automatically be part of the emails sent to you just as though the user had used their email client to send you an email without involving FileMaker.

                    • 7. Re: Sending email from individual users?
                      KimWilkinson

                      So that's why when I log in as someone else and send the email, it looks like it comes from me instead of the user I'm logged in as (because I'm still logged in to my computer)?

                      Thank you very much!