Implemented connection logic for smtp. Added base class for mail message.