• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

email methods?

 
Eric Johnson
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
Eric Johnson
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic