A formal email differs from a casual email. A casual email usually goes to a person you know well—often it's someone you're on good terms with such as a friend or family member. When sending a casual email, you don't need to worry as much about structure and tone.
In fact, part of what makes a formal email different from a casual email is the structure. A formal email has a very defined structure, with a definite salutation (the opening part of the email), signature section, opening sentence, and body.
You also use language differently in a formal email than in a casual email. Avoid using abbreviations, contractions, slang, emoticons, and other informal terminology. The tone of a formal email is different as well. An informal email may not even use complete sentences or proper grammar, but a formal email always does.