Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

send email with java.net.URL  RSS feed

 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • 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
  • 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!

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!