I would like to know if there is a way to send an e-mail alert from a Java
application? I am writing a little routine that checks to see of our remote
servers are up and running as well as our Oracle database. What I would
like to do is have certain individuals e-mail (via our pagers) if either
the server(s) or database is down?
Thanks
JAB
04-06-2000, 06:57 AM
Venkat Ramana
Re: E-mail from Java
"JAB" <brunoj@netcarrier.com> wrote:
>
>I would like to know if there is a way to send an e-mail alert from a Java
>application? I am writing a little routine that checks to see of our remote
>servers are up and running as well as our Oracle database. What I would
>like to do is have certain individuals e-mail (via our pagers) if either
>the server(s) or database is down?
>
>Thanks
>JAB
Hi,
Attached is the code for sending an email from java.
You need JavaMail package to be installed and your CLASSPATH should
be containing mail.jar.
This will run on Unix machine/not tested on NT...
/*VENKAT*/
--------
import java.io.*;
import java.net.InetAddress;
import java.util.Properties;
import java.util.Date;