You can use the JavaMail API, designed to support mail handling, filing
and processing or use one of the many free available mail classes that
abstract the details of sending email into simple, convenient method
calls. (i.e. http://www.coolservlets.com)
Another example is the sun.net.smtp.SmtpClient class with is subject
to change and unsupported:

import sun.net.smtp.SmtpClient;
...
try {
        SmtpClient smtp = new SmtpClient();
        smtp.from("[EMAIL PROTECTED]");
        smtp.to("[EMAIL PROTECTED]");
        PrintStream msg = smtp.startMessage();
        msg.println("To: [EMAIL PROTECTED]");
        msg.println("Subject: Test");
        msg.println();
        msg.println("message goes here");
        smtp.closeServer();
} catch (IOException e) {}
...

[EMAIL PROTECTED] wrote:
> 
> Hey all,
>         How would one go about sending e-mail from an application?  I have
> tried doing it via the Runtime.exec() method and running a long drawn out
> 'mail' command, but the system executes it too fast and it ends up getting
> garbled in the process.  Any ideas?
> 
> Thanks,
> Abe
> 
> Abe L. Getchell - Systems Engineer
> System Support Services
> Kentucky Department of Education
> Voice   502-564-2020x225
> E-mail  [EMAIL PROTECTED]
> Web     http://www.kde.state.ky.us/
> 
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to