Fixed error handling and success message after sending.