MailPost -- Save to File example

MailPost can save the results of a form submission in just about any format you want by using a template file. In this example, MailPost will save the information in a comma delimited format.

The following actions were taken to produce the result:

  1. Create the form and insert the success variable
  2. Create the form's template file that will be used with this form. This example's template file is named save.txt
    To:
    From: mailpost@mcenter.com
    Subject: Save to test
    X-SaveAs: result.txt
    X-SaveUsing: format.txt
    
      This is a test for the Save File feature.

    Note that the "To:" header is left blank. This instructs MailPost not to send an email message. The X-SaveAs: header contains the filename to save the results to. For this example, this file will be result.txt . The X-SaveUsing: header contains the name of the template file to use to format the file. All file paths are relative to the form's template file (save.txt).
  3. Create the "format.txt" template file
    "[required-name]","[required-city]","[required-country]"

If the X-SaveUsing: header is not supplied or is blank, the form values will be stored in comma delimited format.

  
Name
City
Country

  
 

MailPost Homepage