Giter VIP home page Giter VIP logo

Comments (5)

bbottema avatar bbottema commented on August 17, 2024

Can you provide some example code where this happens?

from simple-java-mail.

ben-manes avatar ben-manes commented on August 17, 2024

MimeMessageHelper#getBodyPartFromDatasource is pretty clear. If dataSource.getName() returns null or empty then it uses the name specified in the Attachment. Otherwise it uses the source resource's name.

I imagine any test code I show you won't be too insightful beyond the above, as my usage is pretty benign (thanks to your clean api). To reproduce you can add an attachment like,

URL url = new URL("https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png");
email.addAttachment("logo.png", new URLDataSource(url));

and the email will have a file named googlelogo_color_272x92dp.png instead of logo.png.

from simple-java-mail.

bbottema avatar bbottema commented on August 17, 2024

I've been refactoring this part for the past hour and I think it will be solved now with the next release.

/edit just tested your case which was working correctly now.

from simple-java-mail.

ben-manes avatar ben-manes commented on August 17, 2024

Thanks! 👍

from simple-java-mail.

bbottema avatar bbottema commented on August 17, 2024

Released in v4.1.0.

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.