implemented sending emails