Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

basic question about 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,
I succeeded to send email from a jsp page using the smtp server provided by my ISP...
Now i will give my web jsp application to another person who will run it on his own machine with surely different ISP and country.
my question is : would it work for him as it worked on my machine.

i didn't used any authentication for smtp server just the host name.

is it mandatory to use authentication (username and password ) provided by my isp?

thnx for your time
 
Marshal
Posts: 28289
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
That other person will have to ask their ISP that. It is very likely they will have to use authentication, but the answer depends on how the other person's network is configured and how their ISP's network is configured. And on their ISP's policies regarding spam prevention.
 
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 paul,

so probably a solution is to use a free email service that doesn't use authentication and security limitations . right ?
do you know of such free email servers ?
or maybe do you have another solution to this issue.

thnx
 
Paul Clapham
Marshal
Posts: 28289
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
No. The solution is to use a professional ISP and authenticate yourself to it. If you can't do that then you shouldn't be using computers to generate e-mail messages.

There's a thing called "spam". I am sure you have heard of it. Now, if you are running an SMTP server then it needs to be visible to the Internet, so that other SMTP servers can communicate with it. But if it's visible to the Internet then everybody in the world can communicate with it, and ask it to send e-mail messages on their behalf. That's why they ask you to authenticate yourself.

And, if you try to "work around" that requirement by some trick, many SMTP servers will see that trick and decide your e-mail messages are spam. You don't want that to happen.

If your ISP didn't require you to authenticate yourself, that's possibly because your computer was actually part of the ISP's network, and you had to do some other authentication to make that happen. That commonly happens if you're connecting via dialup.
 
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
Excellent reply thnx !
this is the first time i'll be sending email from a jsp page..so bare with a poor newbie like me

here is the simple code i used from a jsp page :



now how can i add the part for authentication with my username and password provided by my ISP?
that would be nice if you provide some code because i'm still new to JavaMail.

thnx indeed.
 
Paul Clapham
Marshal
Posts: 28289
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
Also: those free servers do exist. But they are usually "black-listed" by most services that scan e-mail messages for spam, so I don't recommend searching for them.
 
Paul Clapham
Marshal
Posts: 28289
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
That "SmtpClient" class actually isn't part of JavaMail. I think it is an undocumented class in one of the "sun.*" packages, which you shouldn't be using because (a) they are undocumented and (b) they aren't guaranteed to exist in future releases of Java.

There's a good tutorial on JavaMail here:

http://java.sun.com/developer/onlineTraining/JavaMail/contents.html

(By the way, I don't keep that link in my browser or anything like that. I just open Google and type in "javamail tutorial". You will find that technique very useful for finding information.)
reply
    Bookmark Topic Watch Topic
  • New Topic