It's not a secret anymore!*
The moose likes Java in General and the fly likes mail send Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "mail send" Watch "mail send" New topic
Author

mail send

Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
In order to send mail I have to include java.mail and setup my own mail server if I know how, which I don't,
or glue to gmail or something, which brings in other limitations.

I hear PHP has a module that you include in your project and you are ready to go, no external mail servers !

Is there something like that for java outthere ?


Searchable nature photo gallery: http://agrozoo.net/jsp/Galery.jsp?l2=en
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
Yes, there is: the Aspirin library is an embeddable send-only mail server.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19653
    
  18

James is a mail server written in Java. You can try that.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
so, I went with aspirin, works fine but want to know if mail was realy posted...... By instructions there:


And since it is success, hasSucceeded becomes true. But I have no idea how it is ment to read that outside this class ?
Need help about that.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41114
    
  45
You can add a public getter method that allows access to the boolean variables from outside the object.

Or you can add a callback into some other code that handles it.


Ping & DNS - my free Android networking tools app
Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
Could do that, public getter.
But, what is this, it removes itself(as far as I can see) in last line, how can I read it then ?


EDIT: hmm, or tihs is realy in its essence olny example and I shoud move all que.removeWatcher out of this class, or something.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41114
    
  45
You should definitely customize the class to suit your needs.

That line simply removes that watcher object from the mail queue - it does not otherwise alter the object, so you can still use it any way you like (assuming that you have stored a reference to it somewhere, obviously).
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: mail send
 
Similar Threads
providing email functionality using struts
Open selected table row in edit mode in JSP using javascript
<error-page> tag in web.xml is not working
Letter of Release
got only 56% in HFSJ mock.....