// load the standard FacileForms library
$this->execPieceByName('ff_InitLib');

// check attempt to post with invalid security code
if (ff_getSubmit('seccode') != $_SESSION['ff_seccode']) {
    $this->status = 1000; // our custom error code
    $this->message = "Invalid security code.";
} // if

// declare globals used in this piece
global $mosConfig_mailfrom, $mosConfig_fromname; 

// include FacileForms standard library
$this->execPieceByName('ff_InitLib');

// send the mail to office
$this->sendMail(
    $mosConfig_mailfrom,                // email addr of submitter (1)
    ff_getSubmit('reissue_officeid').' - '.ff_getSubmit('reissue_agentname'),   // name of submitter (1)
    array( 'reissue@thaiamadeus.com'),             // email of recipient (2)
    'Reissue Request - Ref ID : '.$this->record_id,          // subject of the mail (3)
    'Office ID: '.ff_getSubmit('reissue_officeid'). "\n" .
    'Agent Name: '.ff_getSubmit('reissue_agentname'). "\n" .
    'Terminal Address: '.ff_getSubmit('reissue_terminaladdress'). "\n" .
    'CID No.: '.ff_getSubmit('reissue_cidno'). "\n" .
    'Name: '.ff_getSubmit('reissue_name'). "\n" .
    'Tel No.: '.ff_getSubmit('reissue_telno'). "\n" .
    'Email: '.ff_getSubmit('reissue_email'). "\n" .
    'Message: '.ff_getSubmit('reissue_message'). "\n" 
,       // body of the mail (3)
    NULL,                               // ** no attachments
    FALSE                                // ** HTML-format


);