aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes embeded java smtp server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "embeded java smtp server" Watch "embeded java smtp server" New topic
Author

embeded java smtp server

Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

Hi guys,

I'm having difficulties solving an issue with sending email from a jsp page.
when i use the smtp host name provided by my ISP it just work great...but if the web application is run on another machine with a different ISP connection it doesn't work...the client can't provide me with his smtp sever host ...

so i'm thinking of ways to connect to a free public smtp server and use it to send email....i tried myjavaserver.com but without success (i don't know if their services r still available).

I thought then using a free open source minimal smtp server in the form of a jar library...i can use it to send email from jsp.
does some one knows of such minimal smtp servers ? (need it to be free open source)
I would appreciate any other solution to my problem.

thanking you.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

You will find a "free public SMTP server" hard to find. If such a thing existed, it would quickly be discovered and used by spammers to send unsolicited advertising. Then it would quickly be blacklisted and most other SMTP servers would stop accepting messages from it.

Apache James is a free open-source SMTP written in Java. You could experiment with that. But make sure that if you are sending messages from your SMTP server and the "from" address is, let's say, "othman@something.org", that your server is set up correctly. It must be set up so that it will be the SMTP server for "something.org", otherwise many other servers will do a reverse DNS check and decide you are sending forged messages. (Nothing stops you from using "billgates@microsoft.com" as your "from" address, but other servers can tell you are not sending it from Microsoft's domain.)

So, besides an SMTP server you are going to need a domain name. I doubt that you can get away with using your IP address, e.g. "From: othman@40.127.16.84", either.
Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

Thank you for interesting clarifications.

I suppose that apache james should be installed and setup on the same machine running my web application. right ?

How about using public smtp servers like gmail ? do u have an Idea on how to use gmail to send emails ?
is it reliable to use such servers (myjavaserver.com , gmail etc..) or would it be some security restrictions ?

thanking you.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

If you wanted to use Apache James, then just like any other SMTP server it could be installed on any machine anywhere. Your programs would just need to be able to connect to it over the network.

As for gmail, you could use that. Your code would have to authenticate itself to the server, and naturally you would have to be sending from a gmail address. Other Internet mail servers (for example the one I use, which isn't Hotmail) also allow authenticated access but there's usually a small annual fee. If any of them allow connections from a program, they should also provide you with documentation on how to do that.
Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

thnx a lot

one more question please : do u have an Idea about myjavaserver.com ?

I tried using their server without success...i'm also uncapable to post messages on their forums...Is there a problem with their website services ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: embeded java smtp server