Monday, July 27, 2009

How do I send an email from a Java program?

I am running a large simulation on a machine in a remote building. The simulation is just a plain Java program with no GUI. I want to the program to email me results and notify my of any problems (to avoid the travel to the building).





[Computer is beyond firewalls, and setting up SSH on it is not practical.]





I found some example code but am having problems with "import javax". Any ideas how to get it to work?

How do I send an email from a Java program?
If you're using the SE version of Java, you have to download an optional package to use the javax.mail library.





You can read more about it at the link below.
Reply:Use a socket to establish a connection to the mail server. then look up whatever protocol your mail server uses and have the java program manually interact with it.





Simple and effective.

video cards

No comments:

Post a Comment