Giter VIP home page Giter VIP logo

Comments (7)

bbottema avatar bbottema commented on August 17, 2024

Hi @zimmi. Unless you mail to a huge number of people a lot of times, it's not going to much of a difference.

Still, you have a valid point as quite some configuration is going on in JavaMail: when a Mailer is instantiated, a Session is produced as well and that potentially does a lot of configuring depending on JavaMail specific config files in your META-INF folder.

It's perfectly fine to reuse a Mailer instance multiple times as it is not modifying its state after it is configured. I'll add a line somewhere and example.

Thanks!

from simple-java-mail.

bbottema avatar bbottema commented on August 17, 2024

I updated the documentation with an extra line in basic usage and an extra example demonstrating it. Amazon Cloudfront will take a few minutes to reflect the update though.

from simple-java-mail.

zimmi avatar zimmi commented on August 17, 2024

Awesome,thanks! You fixed it before I could even say thanks for the clarification. :)

from simple-java-mail.

noguespi avatar noguespi commented on August 17, 2024

I understand "A Mailer instance is reusable" but is it thread safe ? Because stating it is reusable doesn't mean it is thread safe.

Should I wrap the call to mailer.sendMail() with locking or is the mailer instance thread safe ? Thanks.

from simple-java-mail.

bbottema avatar bbottema commented on August 17, 2024

@noguespi, It is thread safe. There is no mutable state once a Mailer has been built and internally Mailer uses Java 8's concurrent facilities to maintain thread safety for running mail sessions.

from simple-java-mail.

noguespi avatar noguespi commented on August 17, 2024

Thank you, btw your api is very nice and fluent, very good job.

from simple-java-mail.

bbottema avatar bbottema commented on August 17, 2024

Thanks!

from simple-java-mail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.