-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Design of Library #3
Comments
Builder PatternThe Builder pattern is the best option for this. The main issue being: Because of this a few of the required fields might not be initialized, for example:
If any of those fields is not initialized the email won't be sent. I'm not saying that the builder approach should be completely removed, but it need to be changed to have some required fields and some optional fields. I have some ideas on how to approach this, let me know if you are interested on this improvement. |
SuccessCallback DesignThe current successCallback implementation needs to be improved, right now the way it is done it behaves in the following way.
This is why this is not a good approach:
A callback shouldn't be tied to some arbitrary timeout, callback are expected to be called when the process is ended or some error occurred . ApproachRun the callback at the end of the execution or when an error happens. |
Amazing, you did great analysis. I agree with everything said. 👍 |
If I send a message to a bad address, why don't I get a SendFailedException or TransportEvent indicating that the address is bad? |
There is no end-to-end address verification on the Internet. Often a message will need to be forwarded to several mail servers before reaching one that can determine whether or not it can deliver the message. If a failure occurs in one of these later steps, the message will typically be returned to the sender as undeliverable. A successful "send" indicates only that the mail server has accepted the message and will try to deliver it. From javamail-api |
Please share your feedback if you want to use this library and help us grow 🎉
We strive for improvement so any feedback even slightest is always welcome.
The text was updated successfully, but these errors were encountered: