Catching all attachments, encoding, dynamic SQL table creation