Sending e-mails in an application

Hi all,

Is it possible to send e-mail in a java application without using Java Mail API?

Or is there a link or somebody that can simply installing these additional thing to java like Java Mail or Java sound (I think). Because I am very confused with where to copy these files, what to do with jar file and how all are related witj classpath and path variables. If someone can explain step by step, I will be glad.

Thanks for all help...

[461 byte] By [protennisera] at [2007-11-26 23:55:43]
# 1
http://www.google.com/search?q=java+mailto
ChuckBinga at 2007-7-11 15:40:02 > top of Java-index,Java Essentials,Java Programming...
# 2
[url= http://en.wikipedia.org/wiki/Zawinski's_law_of_software_envelopment]Zawinski's Law of Software Envelopment[/url]
TuringPesta at 2007-7-11 15:40:02 > top of Java-index,Java Essentials,Java Programming...
# 3

Hi TuringPest ,

Without being 100% sure, from Zawinski's Law, I unserdtood that java can send and recieve mails (since it still exists.). But how? Please somebody help? I am very confused how to install, etc. external projects or etc. that doesn't come with jdk. And I think MailTo is also an external one. (I couldn't see it in the last version of the api in sun's site.)

So please some more explanations...

Thanks all....

protennisera at 2007-7-11 15:40:02 > top of Java-index,Java Essentials,Java Programming...
# 4

Hi all,

Thanks to ChuckBing, I could find some information about mailing without using external classes. (Mailto) I have found that example code.

import java.io.*;

import java.net.*;

public class mailto {

public static void main(String[] args) {

try {

URLurl =

new URL("mailto:foo@bar.com");

URLConnection conn =

url.openConnection();

PrintStreamout =

new PrintStream(conn.getOutputStream(), true);

out.print(

"From: jguru-fan@yourisp.com"+"\r\n");

out.print(

"Subject: Works Great!"+"\r\n");

out.print(

"Thanks for the example - it works great!"+"\r\n");

out.close();

System.out.println("Message Sent");

} catch (IOException e) {

System.out.println("Send Failed");

e.printStackTrace();

}

}

}

Could anybody modify this code, so it sends the message from protenniser@gmail.com to protenniser@gmail.com. Without being sure, I think that gmail SMTP is smtp.google.com. Thanks for all help.

Regards...

protennisera at 2007-7-11 15:40:02 > top of Java-index,Java Essentials,Java Programming...