Have you correctly used a valid username and password when connecting to a SMTP server? You could check by telneting to the server.

khushi paul
Greenhorn

Joined: Feb 08, 2005
Posts: 26

posted Feb 08, 2005 21:52:00

0

thanks 4 ur reply kashif...i m using following code,can u pls tell me where shud i provide username n password.. moreover is it not possible to send mail if i don't know the user name or passwrd of server?is there any way possible?

You can write a small class which extends javax.mail.Authenticator.Override the method getPasswordAuthentication().Pass the object of the small class: Session ses1 = Session.getDefaultInstance(prop,new smallClass()); If you download Free SMTP/POP3 server,there is no need to pass Authentication.