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

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

// send the mail
$this->sendMail(
    $mosConfig_mailfrom,                // email addr of submitter (1)
    $mosConfig_fromname.' - Message',   // name of submitter (1)
    ff_getSubmit('email'),              // email of recipient (2)
    ff_getSubmit('subject'),            // subject of the mail (3)
    ff_getSubmit('message')             // body of the mail (3)
);

/*--------------------------------------------------------------------
Notes:

(1) In this sample we use the site admin as submitter of the email,
    but basicly you could use anything. Note that many mail servers 
    however impose constraints about the submitters email address and
    in case refuse to sent the mail to prevent from spamming. (This
    will mostly be reported as 'relaying denied').

(2) Recipient can also be an array of email addresses if you want to 
    send the same mail to multiple recipients. Note that all email
    adresses will however be visible to all recipients, so maybe
    it is better to call $this->sendMail for each recipient 
    individually.

(3) Subject and body could of cause also be composed here in the 
    piece instead of taking it completely from the submitted values.
--------------------------------------------------------------------*/