Meaningless Drivel is fun!*
The moose likes Other JSE/JEE APIs and the fly likes Java Mail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Java Mail" Watch "Java Mail" New topic
Author

Java Mail

amit jangir
Greenhorn

Joined: Jan 12, 2010
Posts: 1
How to mail without using a mail server.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12809
    
    5
All mail has to go through a mail server.

If you have a permanent address you can run a Java mail server - for example the open source James server.

Bill
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42360
    
  64
Check out https://aspirin.dev.java.net/ - it is an embeddable send-only mail server written in Java. In other words, it implements SMTP, but not POP or IMAP.


Ping & DNS - my free Android networking tools app
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

Ulf Dittmer wrote:it implements SMTP, but not POP or IMAP.


Which is by definition, what a "mail server" does. As originally posted, I don't think its possible. You can't send mail without talking to a Mail Transfer Agent aka MTA.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42360
    
  64
Pat Farrell wrote:
Ulf Dittmer wrote:it implements SMTP, but not POP or IMAP.

Which is by definition, what a "mail server" does.

Not sure which definition you go by, but some mail servers handle outgoing mail only, while others handle both incoming and outgoing mail; so it's important to state what Aspirin does. I'm fairly certain that the question is about whether the sending side needs a mail-sending process that's outside of the mail-sending client, and the answer to that is no. If the question is, in fact, about something else, then Amit can clarify.
Raphael Okochu
Greenhorn

Joined: Jul 17, 2009
Posts: 22
Hi, I dunno what you mean by sending mails without a mail server but if you mean testing your javamail application, you can use mock-javamail- just drop the jar in your classpath and it will look like you are connected to a mail server. But this is used for testing and debugging only. Download the jar from grep code


SCJP 5
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Java Mail