Add email sending capability but still have lots of issue