problem with check_markup()
You should do like this

$format = db_result(db_query("SELECT format FROM {filter_formats}
                              WHERE name = 'Messaging plain text';"));
$content .= check_markup($node-&gt;title, $format);


The problem is that you need to use the format id not the format name.