File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes email methods? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "email methods?" Watch "email methods?" New topic
Author

email methods?

Eric Johnson
Ranch Hand

Joined: Apr 30, 2001
Posts: 49
i am trying to find a way for a way for an applet to send info via email. i'm searching through the different packages in the api, but having no luck. i would really appreciate it if someone could point me in the right dirrection. plus i want a shot at that book!
also, i know to use the ubb code tag to display code in an easy to see way on the boards here, but haven't been able to get the font size to work. any pointers?
Ian Darwin
author
Ranch Hand

Joined: Aug 03, 2001
Posts: 64
The reason you can't find this in "the API" is that it's not in the Java 2 Standard Edition. The Java Mail package is included in the Java 2 Enterprise Edition or can be downloaded from this corrected URL: http://java.sun.com/products/javamail. I have a chapter on it (chapter 19) in my Java Cookbook.
Originally posted by Eric Johnson:
i am trying to find a way for a way for an applet to send info via email. i'm searching through the different packages in the api, but having no luck. i would really appreciate it if someone could point me in the right dirrection.


------------------
Ian Darwin,
Author of Java Cookbook: Solutions and Examples for Java Developers
[This message has been edited by Ian Darwin (edited September 26, 2001).]


Ian Darwin
Many questions are answered in my Java Cookbook, 2nd Edition
Eric Johnson
Ranch Hand

Joined: Apr 30, 2001
Posts: 49
thanx! i was on a snipe hunt it would seem. >;P
hmm, bad url. i know what i need now though, thanx again. i look foreward to reading your book.
here is where to get
javamail 1.2
[This message has been edited by Eric Johnson (edited September 26, 2001).]
[This message has been edited by Cindy Glass (edited September 28, 2001).]
David Weitzman
Ranch Hand

Joined: Jul 27, 2001
Posts: 1365
The key word is applet. For security reasons it is hard to send email from an applet without special server scripts. You cannot open sockets to any port or server other than the one the applet is loaded from. You would need a more liberal than normal security policy file for Java 2, or browser specific security api's for less recent virtual machines. If you can set up a relay server (or whatever type you want) that can also serve web pages, it might be easier.
Ian Darwin
author
Ranch Hand

Joined: Aug 03, 2001
Posts: 64
Originally posted by David Garland:
The key word is [b]applet. For security reasons it is hard to send email from an applet without special server scripts. You cannot open sockets to any port or server other than the one the applet is loaded from. You would need a more liberal than normal security policy file for Java 2, or browser specific security api's for less recent virtual machines. If you can set up a relay server (or whatever type you want) that can also serve web pages, it might be easier.[/B]

More simply, just be sure that your web/applet server is also running an SMTP server (sendmail, postfix, or the newer, all-java James Java Enterprise Mail Server.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10

also, i know to use the ubb code tag to display code in an easy to see way on the boards here, but haven't been able to get the font size to work. any pointers?



Try putting a '+' between "size=" and "2.5". I use < font size=+0>. Seems to work fine.
[This message has been edited by Marilyn deQueiroz (edited September 26, 2001).]
[This message has been edited by Cindy Glass (edited September 28, 2001).]


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: email methods?