Mail merge is a software function describing the production of multiple (and potentially large numbers of) documents from a single template form and a structured data source. This helps to create personalized letters and pre-addressed envelopes or mailing labels for mass mailings from a word processing document which contains fixed text, which will be the same in each output document, and variables, which act as placeholders that are replaced by text from the data source. The data source is typically a spreadsheet or a database which has a field or column matching each variable in the template. When the mail merge is run, the word processing system creates an output document for each row in the database, using the fixed text exactly as it appears in the template, but substituting the data variables in the template with the values from the matching columns.
This technique of merging data to create mailshots gave rise to the term mail merge.
A feature supported by many word processors that enables you to generate form letters. To use a mail-merge system, you first store a set of information, like a list of names and addresses, in one file. In another file, you write a letter, substituting special symbols in place of names and addresses (or whatever other information will come from the first file). For example, you might write: