nedimf / maildroid

Maildroid is a small robust android library for sending emails using SMTP server
188 stars 24 forks source link

Add failure reason/exception to onFail method of onCompleteCallback #12

Closed jamiehiggins closed 5 years ago

jamiehiggins commented 5 years ago

Firstly thanks for the library, I've just started using it and it seems to work really well.

What I am lacking though is a way to understand why an email send failed. It would be great if we could get at an underlying exception and/or failure reason in the onFail callback. This is important because if we allow a user to enter SMTP details for their own server and for example they make a typo there is just no way for my app to know or to convey to them why the email send may be failing.

nedimf commented 5 years ago

We are trying to make error callback more usefull. Problem relays on Java Mail API how they handle errors. We will try to implement solution to check for same values as original Java Mail API does.

Thank you for using library :bow:

nedimf commented 5 years ago

From latest commit, errorMessage is present that is showing results from try/catch block. @jamiehiggins have look and let me know if this what you have asked for.

jamiehiggins commented 5 years ago

Many thanks for this, it looks perfect for my needs

nedimf commented 5 years ago

Great, have fun :smile: