LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-29-2004, 05:31 PM   #1
naijaguy
Member
 
Registered: Aug 2004
Posts: 88

Rep: Reputation: 15
need simple way to email attachment in java


We have an existing Java web application that occasionally needs to send users an email with an image attachment. Right now, the J2EE web app is running on Tomcat in Windows, and we just have it exec() a process that runs the tiny little Blat program, like this:


Code:
    try {
      Process blatProcess = java.lang.Runtime.getRuntime().exec(new String[] {
          "C:\\blat222\\full\\blat.exe", "-", "-server", smtpHost,
          "-f", copyAddress, "-from", "Mailer@noreply.com",
          "-subject", "ID #" + idNumber,
          "-to", this.getRecipientAddress(),
          "-bcc", bccAddress,
                   "-replyto", this.getSenderAddress(), "-attach", attachmentAbsolutePath,
                   "-body", messageText});
    }
    catch (IOException e) {
      System.out.println("Problem with running Blat: " + e);
    }

As you can see, all I need to be able to do is send a little email with an image attachment. I don't even care if I can't BCC our log email address anymore. What would be the quickest/simplest/easiest solution to get the same functionality when we move this web app to Tomcat on Linux? From what I've read, sendmail might be a bigger deal than what I'm looking for. I don't think there's any way for me to attach to the email in pure Java without getting into the JavaMail API.

Thanks...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: email file as attachment mikeshn Programming 5 11-08-2004 10:17 PM
Treatment of virus in email attachment royschnettler Linux - Newbie 6 08-07-2004 04:33 AM
account and email attachment limit red_phoenix Debian 2 09-16-2003 03:22 AM
cannot receive email with attachment charles168 Linux - Software 2 09-06-2003 09:43 AM
Is it safe to open a .scr attachment in an email? BajaNick General 10 09-04-2003 10:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration