In MailsController.php:history() you sent the variable $mails
to your view (history.ctp).
In your view, you can access $mails
as you would any other PHP variable. Since this will be an array, you will want to use a loop to display the data:
foreach ($mails as $mail) {
echo $mail['Mail']['fromUsername']; // Modify according to your data and required output.
}
To see what $mails contains in your script (for debugging purposes), you can dump its contents:
var_dump($mails);