• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

send email with java.net.URL

 
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I routinely send email without using JavaMail by making use of the java.net.URL class. However, I'm wondering if there's a way to send an attachment using this. Here's some sample code that works quite well:



So if you can figure out how to attach something to this email, let me know. Thanks!
 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found a decent solution in Windows (I guess you have some built-in ones if you're running *nix). Well, two. I know you can send mail from the command line if you have the MS Outlook client installed. If you don't, then there's this really handy and FREE command line utility that you can call with Java's exec method, and what's more, it lets you send attachments! Have fun with Blat!

 
I am not young enough to know everything. - Oscar Wilde This tiny ad thinks it knows more than Oscar:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic