• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

embeded java smtp server

 
Ranch Hand
Posts: 510
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 28295
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 510
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Marshal
Posts: 28295
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 510
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 am Arthur, King of the Britons. And this is a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic