Improve several classes

Implement mail notification.

Fix Connection class.