Royal Mail Mailmark

Royal Mail Mailmark 4-state barcode in PHP: type C and L application strings, code examples and SVG output

Mailmark replaced RM4SCC for bulk mail, adding the reporting data that the service is built on. The application string is 22 characters for the C barcode or 26 for the L, and packs a format code, a version, a class, the Supply Chain ID that Royal Mail issues, an item identifier and the destination postcode.

The two lengths are the two barcode types; nothing else selects between them.

Type Token

ItemValue
Type tokenMAILMARK
Enum caseBarcodeType::MAILMARK
FamilyPostal
StandardRoyal Mail Mailmark
Class\Com\Tecnick\Barcode\Type\Linear\Mailmark

Input

ItemValue
Character set0-9, A-Z and space, with the field-by-field rules of the specification
Lengthexactly 22 characters for type C, or 26 for type L
CheckReed-Solomon check symbols, computed by the library
Extra parametersnone

Examples

A type C application string

<?php

require_once __DIR__ . '/vendor/autoload.php';

$barcode = new \Com\Tecnick\Barcode\Barcode();
$bobj = $barcode->getBarcodeObj(
    type: 'MAILMARK',
    code: '41038422416563762EF61AH8T ',
    width: -3,
    height: -30,
    color: 'black',
    padding: [0, 0, 0, 0],
)->setBackgroundColor('white');

echo $bobj->getInlineSvgCode();

Royal Mail Mailmark barcode encoding 41038422416563762EF61AH8T

Errors

These payloads raise \Com\Tecnick\Barcode\Exception:

PayloadMessage
4103842241656376The application string must be 22 characters for the barcode C or 26 for the barcode L, 16 given
91038422416563762EF61AH8TInvalid character: 57

See Also