Uncommented code from previous steps.
This was commented in order to test Stage 3. Now it's ok to uncomment it.
Rearranged looping structure and added exit option
Added method to test each command for the text 'QUIT'. If true, the
programme exits. Also made the programme exit after the mail is
successfully sent.