Utilities for DOS and legacy programsFileInMail

FileInMail configuration

 Automatically send out files via e-mail

Chapter 3 - FileInMail configuration

FileInMail configuration is usually performed by the graphical configuration dialogs you can access by right clicking the trayed icon (in the bottom right corner, near the Windows clock) and choosing Configuration -> Guided or Configuration -> Standard.

All the FileInMail's settings are then stored in the FileInMail.INI file. By default this file is automatically placed in the Windows standard directory, which normally is C:\Windows or C:\WinNT in client systems (Windows 98, ME, NT, 2000, XP),  C:\Users\Your UserName\AppData\Local\ VirtualStore\Windows in Windows Vista, Windows 8, Windows 10, Windows 11, and %HOMEPATH%\Windows in Terminal Server environments (Windows 2000, 2003, 2008, 2012, 2016, 2019, 2022).

You can even edit the FileInMail.ini file with a simple text editor like Notepad or Edit.com, but please note that in this case FileInMail has to be restarted to activate the changes.

At FileInMail startup, the FileInMail.INI file will be searched in the current path first. If not found, it will be searched in the default location above.

It contains 2 sections: [FileMail] and  [Options]. For example:


Addr-1=John Doe <john.doe@domain.com>; Jane Roe <cc:jane.roe@domain.com>
Subj-1=PDF document
Body-1=The attached PDF has been automatically sent by FileInMail...

DynamicINI=C:\External Program\dyn.ini

[FileMail] section

This section contains the main entries, used to know which files should be monitored and how to compose the e-mail message when one or more of those files appears on the specified location. FileInMail can check for multiple locations simultaneously, so each entry has a number at the end to group the different settings together (Path-1, Path-2, etc.). The number MUST be consecutive.


This is the location to monitor for the appearance of new files.

The path normally contains wildcards (? , *) to check for multiple files simultaneously and the full path (the example above means: all the PDF files in the IncomingFiles folder).


The list of recipients, separated by ";". You can specify each single address just as user@domain.com or as Name <user@domain.com>

If FileInMail is configured to send out mail via smtp (please see EMailClient on this page) you can specify e-mail addresses even in Cc (Carbon Copy) and Bcc (Blind Carbon Copy), such as cc:user@domain.com or Name <bcc:user@domain.com>

In the example above, the PDF's are sent to both John Doe and Jane Roe In the example above, the PDF's are sent to both John Doe and Jane Roe (in Carbon Copy)


A single line of text containing the subject of the e-mail message (that will contain the PDF in our example above)

It can contain the same variables described in the next section: Body-n


This is the mail Body. In the INI file, all the body is translated into a single line of text (about 1000 characters available) even if the graphical dialogs allows you to insert a multiline mail body (and the sent mail will have a multiline body too). To do so, all the "New Line" characters are translated as [CR]. For example, the mail body:

Hello guys,
please find attached the file I promised you.

is stored in the FileInMail.ini file as:

Body-1=Hello guys,[CR]please find attached the file I promised you.

In addition, you can specify different variables in the mail body:

  • [PROG] = The FileInMail version actually installed
  • [DATE] = The current date (at the time of the e-mail creation)
  • [TIME] = The current time (at the time of the e-mail creation)
  • [FILE] = The name of the file(s) attached from the source folder (the original location: C:\Incoming Files\Test.pdf in the example above)
  • [AFILE] = The name of file(s) moved in the archiving folder before being attached to the message (if Mode=0, please see the [Options] section in this manual for more information)
  • [FILENP] = Source file(s) (like [FILE] above) but without path (just Test.pdf in the example above)
  • [AFILENP] = Archived file(s) (like [AFILE] above) but without path

Body-1=Hello guys,[CR]please find attached the [FILE] file I promised you.

Show-n ( .T. = true , .F. = false )

If this entry is setup to .T. , the email is shown on the screen before being sent, so that you can modify it (including adding/removing attachments).

Zip-n ( .T. = true , .F. = false )

If this entry is setup to .T. , the files are compressed into ZIP archives before being attached to the e-mail.

Multi-n ( .T. = true , .F. = false )

If this entry is setup to .F. , and multiple files of the same kind (in the example above different PDF files in the IncomingFiles folder) will be detected, FileInMail will generate a separate e-mail message for each source file, with a single file attached.

If this entry is setup to .T. , multiple files will be attached together to a single e-mail message; either as separate attachments or as a single ZIP file containing all of them (depending by how the Zip-n parameter above is setup)

[Options] section

Mode ( 0 = Archive source files , 1 = Keep them in their original locations )

When Mode=0, before sending out the files via e-mail, FileInMail archives them in a directory of your choice. Please see the ArchiveRoot entry below.

When Mode=1, the source files are kept in their original locations.
To keep track of the files that have been already sent out, FileInMail creates an additional file with the same path and name of the source one, and .FileInMail extension.
That's a simple text file containing some info about the mailing; you can open it with any text editor if, later on, you wish to see when the file has been processed, and where it has been emailed.

For example, if FileInMail detects the C:\IncomingFiles\MyFile.PDF, it creates the C:\IncomingFiles\MyFile.PDF.FileInMail file and emails the PDF one, leaving it in C:\IncomingFiles.

Timer ( seconds )

This number is used to set how often (in seconds) FileInMail must check if some files to send are present.

It's not good to set too small a value because FileInMail could intercept a file that an external application hasn't yet finished generating.

The default value is 30 seconds.

DelayMsg ( seconds )

If FileInMail detects multiple files to be emailed separately, you can specify a delay between them.

This is particularly useful if an SMTP server has limits in the number of messages he can handle in a short period of time, or if you wish to "ensure" they're received in the same order they're sent out.

The default value is 1.5 seconds.

DynamicINI ( dynamic configuration )

This entry points to an INI file containing a dynamic configuration that may optionally be created by an external program (for example to send out an invoice to a specific recipient without having to specify it in advance, in the [FileMail] section above).

The DynamicINI file can contain an additional [FileMail] section, with all the entries described above (even multiple entries: Path-n / Addr-n / Subj-n / Body-n), that are read every "Timer" interval.

This way an external program can create a c:\external program\invoice.pdf fle and a c:\external program\dynamic.ini file containing:

Path-1=C:\External Program\Invoice.PDF
Addr-1=John Doe <john.doe@domain.com>
Subj-1=Invoice no. 1
Body-1=Please find attached the Invoice no. 1

After FileInMail has sent the invoice.pdf file, the same program can recreate it and overwrite the dynamic.ini file as follows:

Path-1=C:\External Program\Invoice.PDF
Addr-1=Jane Roe <jane.roe@domain.com>
Subj-1=Invoice no. 2
Body-1=Please find attached the Invoice no. 2

then FileInMail will send the 2nd invoice to the 2nd recipient in background.

EMailClient ( empty, MAPI, SMTP )

To send out E-Mail messages (either your files or Support Requests), FileInMail can use:
  1. Microsoft Outlook
  2. A standard MAPI e-mail client (Microsoft Mail, Mozilla Thunderbird, Outlook Express, ...)
  3. An SMTP server

When EMailClient is empty (the default value), FileInMail gives an higher priority to Microsoft Outlook than to other MAPI clients eventually installed on your machine. So, if Outlook is installed, FileInMail will invoke it (1), otherwise it will invoke the default MAPI mail client (2).

If Microsoft Outlook is installed on your machine, but you are used to use another MAPI client (like Microsoft Outlook Express or Mozilla Thunderbird), then you can force FileInMail using it (2) by setting EMailClient=MAPI (or by selecting this option FileInMail's standard Configuration dialog, Options tab).

If you don't use neither Outlook nor a standard MAPI client, or however if you don't want to use any mail client program, then you can have FileInMail using any standard SMTP server (3), by setting up EMailClient as follows:

EMailClient = SMTP |Sender | Smtp Server | Smtp Port | Authentication | Username | Password | SSL

The first part (SMTP) is fixed. All fields are separated by a pipe ("|" - Ascii-124) 

Sender is your own e-mail address. For example: John Doe <john@doe.com> or simply john@doe.com. It's needed to receive replies.

Smtp Server can be specify as an IP address ( xxx.xxx.xxx.xxx ) or by it's canonical name ( smtp.server.com ). These details are provided by your own ISP (Internet Service Provider) and are the same you'll have to insert in any mail client program to allow it sending out e-mail messages.

Smtp Port is optional. The default port for an SMTP server is 25, but some providers are used to use a different port (Google's smtp.gmail.com for example does use port no. 465, and SSL authentication - please see below)

Authentication is optional. If your mail server requires authentication you can setup this parameter=.T. (dot-T-dot)

Username is required only if your mail server requires authentication. Most often this is your full e-mail address (including the domain), unless your ISP provided you different login credentials.

Password is required only if your mail server requires authentication. If you manually edit the FileInMail.ini file, you can specify it as a plain text. If the configuration is setup through the FileInMail's graphical configuration dialog(s), the password is automatically encrypted in the FileInMail.ini file.

SSL authentication is required by some providers (Google's smtp.gmail.com for example). To enable it you've to setup this parameter=.T. (dot-T-dot). If it's missing, or .F., SSL is disabled.
PLEASE NOTE: SSL authentication is not available in Windows 98/ME, you need Windows 2000 or newer to enable it.

SMTP | john@domain.com | smtp.domain.com | 25 | .T. | john@domain.com | Password |.F.

WARNING: Unlike options (1) and (2) above, by sending mail through an SMTP server (3) you'll not automatically obtain a copy of the sent mail in the "Sent Mail" folder of your own mail client (no mail client is used at all in this case).
If you want to keep copies of all the automatically sent messages, you'll have to add your own e-mail address to the recipients (Addr-n in the [FileMail] section) so that you'll receive them too, in your own mail client program. If you prefer, you can add it in Bcc: so that the recipient(s) will not know it has been sent to you too.

ArchiveRoot ( archiving path )

If Mode=0 (see above), before sending out the files via e-mail, FileInMail archives them in a directory of your choice, declared in the ArchiveRoot entry.

For example, if ArchiveRoot=c:\Sent\ , and FileInMail is intercepting the c:\Incoming\MyFile.pdf file, when attaching it to a newly generated e-mail message, the file will be even archived as c:\Sent\MyFile.pdf.
If another MyFile.pdf appears in c:\Incoming, it will be archived as c:\Sent\MyFile1.pdf , then c:\Sent\MyFile2.pdf and so on.

You can also specify a prefix for the file name.
For example: ArchiveRoot=c:\archive\aaa . If the source file is c:\Incoming\MyFile.pdf, it will be archived as c:\archive\aaaMyFile.pdf

So, if you want to specify only a path, take care to insert a backslash ("\") at the end of the ArchiveRoot string, otherwise a simple c:\archive will result in the files: c:\archiveMyFile.pdf , c:\archiveMyFile1.pdf and so on.

You can also include environment variables to change the archiving path dinamically.
For example ArchiveRoot=[e:HOMEPATH]\archive\ , will make FileInMail archiving each user's files into a separate folder, as c:\document and settings\Administrator\archive\ or c:\document and settings\user\archive\ , depending by which user is currently running FileInMail. 
This option is particularly useful on Windows Terminal Server environments, where a single FileInMail installation manages different users, but you can also use it on other Windows versions as well, and for different purposes.

Environment variables must be included in brackets and start with e:. For example: c:\dir\[e:ENV_VAR]\subdir\

If ArchiveRoot specifies a nonexistant path, you'll receive a runtime warning, when FileInMail will try to send out the message.

The more files are archived in the directory, the more time FileInMail needs to find out which is the first available file name, so from time to time, the oldest archived jobs should be removed.
You can do it manually, by deleting them, or by moving them to another location, or by changing the ArchiveRoot entry. Alternatively, you can setup the ArchiveDelDays entry below.

ArchiveDelDays ( number of days: 0 = no )

When FileInMail starts, if Mode=0 (see above), it can automatically delete the files archived in ArchiveRoot which are older than the specified number of days. For example, by setting up ArchiveDelDays=365, the archiving folder will contain only the files of the last year. If this option = 0, the archived files will never be deleted.

Files older than "ArchiveDelDays" days will be shown on a screen grid first, so that the user can see them and choose to delete them all in once, or simply close the window.

WARNING:The ArchiveDelDays parameter can potentially delete files on any disk folder.
Even though for security reasons FileInMail deletes only files where the current Windows user has enough permissions to do so, be careful on choosing the ArchiveRoot path, to avoid deleting system files by mistake.

DelayStartup ( seconds )

This parameter allows you delaying FileInMail's startup of some seconds. This might be useful to ensure that other programs in the "Start -> All Programs -> Startup" folder or complex logon scripts will complete before FileInMail starts.

ShowManX.X ( .T. = true , .F. = false - X.X stands for the FileInMail's version)

If this entry is .T. or it is missing, and FileInMail is run in evaluation mode, at next FileInMail startup this manual and the guided configuration will be automatically opened, then ShowManX.X will be put = .F.
This is the standard setting when FileInMail is run for the first time or when running a newer version in evaluation mode.

ShowPop ( .T. = true , .F. = false )

When used in evaluation mode, FileInMail periodically show a popup message remainding to register the software. By Setting this entry to .F., the messages will no more be shown during the first 20 days of evaluation.

The entry is automatically managed by FileInMail itself, which, after showing you the popup message, will ask you if you want to show it again or not.

SupportEmail ( .F. = false )

By default, if FileInMail execution terminates abnormally, at next startup it shows an automatically generated e-mail to be sent to the Support Team containing an Error Report and the FileInMail configuration on the PC.

The user can always choose whether to send the e-mail or to close the window.

Setting this entry to .F., this Auto Notification Error feature can be disabled, as well as the "Contact Support" menu entry.

If you want to re-enable it later, do not set this entry to .T., but remove the entire line from FileInMail.INI instead.

AutoUpdate ( .F. = false )

FileInMail can automatically connect to our web site to see if an update is available.

By default, the check is done only once at each FileInMail startup, after the user connects to the internet. FileInMail will NOT start an internet connection itself to perform the check.

If the installed FileInMail version is not the latest one, the user can be informed, either by a message box or by an internet web page automatically opened to guide the user through the updating process.

Setting this entry to .F., the Auto Update check will be disabled.

In this case, the only way to check if an update is available is by clicking the "Search for updates" entry in the FileInMail menu.

If you want to re-enable it later, do not set this entry to .T., but remove the entire line from FileInMail.INI instead.

LogFile ( .T. = true , .F. = false )

Normally disabled (.F.), if you set it = .T. , a FileInMail.LOG file will be created in the FileInMail installation directory. This file contains the data exchanged between FileInMail and our web server by the AutoUpdate procedure and the data exchanged with the SMTP server when using the "Test" button at Configuration -> Standard -> Options -> SMTP Settings (only if SSL authentication is NOT enabled) 

- Intro
- News
- Free Trial
- Manual
- Contact us
- Prices
- How to Buy
- Resellers
- Customer Care Center ShareIt

See also ...

Odbc 4 All: SQL software for MS-DOS and batch files
Facebook Youtube Instagram