Adding the sending email code and taking the image