Which one of the following types of writing is considered formal?

AA personal email to a friend
BAn instant message to a co-worker about after-hours plans
CA cover letter with a job application
DAn invitation to an anniversary party