Finishing working version of sending emails example.