A thank-you letter that properly reflects the tone of the occasion is always in good taste. For instance, in response to a formal gathering, a formal tone is appropriate for thanking someone with whom you were not previously acquainted. (You can retain a properly formal tone by using the surnames of the hosts in the greeting, by specifying the date of the event, etc.)