4 Replies Latest reply on Mar 31, 2011 1:16 PM by nancyhorne@centurytel.net

    Send Mail via SMTP Server - script history log?

    nancyhorne@centurytel.net

      Title

      Send Mail via SMTP Server - script history log?

      Post

      I've set up a script to send emails- 'send via SMTP Server in FM 10'.

      I need to create a sent history log -script  the To: CC: Subject Message Timestamp. Several people will send emails after logging in remotely.

      Not sure how to capture this info. Obviously I'll create a table with the fields I want to capture.

      I'm a bit rusty remembering what the script formula should look like and does it go after the send email script step?. Help would be appreciated.

      Thanks in advance!!

      Nancy

        • 1. Re: Send Mail via SMTP Server - script history log?
          bumper

          Set each item to a script variable, $Subject, $CC, $Timestamp etc., then go to the related History table layout, create a new record and set the variables data into the respective field. Those are the basic steps, you'll have the usual housekeeping and clean up. 

          • 2. Re: Send Mail via SMTP Server - script history log?
            nancyhorne@centurytel.net

            Thanks Bumper for your answer, however, I need more information that this to carry out a test. I haven't used script variables so I am not sure where to begin.

            Are there any examples of creating a history log for multiple users who send email using the send mail script?

            • 3. Re: Send Mail via SMTP Server - script history log?
              bumper

              First create a log table that has all the fields for the data you want to keep, relate it to the table you will be sending the email from.

              Then write the email send script as you normally would. Note the basic steps of sending an email and printing are pretty much the same.

              Create script steps for each of the pieces of data you want to log, Click on Set Variable, give your variable a name (you get to pick the name) say: $__ContactName, then set that variable to the data that you want to keep, in this case it will be the data you previously put in the To: field. Do this for each of the pieces of data.

              Then go to a related layout of the log table, create a new record and do a Set Field for each of the variables to their respective fields in the log table. 

              If you are sending one email at a time then finish the script and back to where ever you would normally send the user. If there are multiple emails to be sent then put the above into your loop and you'll go back to the original printing layout and restart the loop.

              A one dollar sign variable, called a local variable, is only good for the run of the script, a two dollar sign variable, called a global variable, stays in memory beyond the run of the session or until you set it to null or empty. Variables are a developers best friend. You'll probably find lots of uses for them.

              HTH, if you need any thing else ask away.

              • 4. Re: Send Mail via SMTP Server - script history log?
                nancyhorne@centurytel.net

                Perfect timing - Thanks very much, I am working on this now.