aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes AutenticationFailedException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "AutenticationFailedException" Watch "AutenticationFailedException" New topic
Author

AutenticationFailedException

nsathishbabu nagarajan
Greenhorn

Joined: Jan 02, 2006
Posts: 6
hi

When i try to run the javamail program form the server,it failsby giving the error authenticationfailedexception.this is the program i am using....

String host="hostname";
String from="name@company.com";
String to="name1@company.com;
Properties prop = System.getProperties();
prop.put("mail.transport.protocol","smtp");
prop.put("mail.smtp.host",host);
prop.put("mail.transport.port","25");
prop.put("mail.smtp.auth","true");
prop.put("mail.smtp.user","username");
prop.put("mail.smtp.password","password");
Session ses = Session.getInstance(prop,null);
Message msg= new MimeMessage(ses);
msg.setFrom(new InternetAddress(from));
msg.setRecipient(Message.RecipientType.TO,new InternetAddress(to));
msg.setSubject("subject");
Transport.send(msg);
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6


prop.put("mail.smtp.auth","true");
prop.put("mail.smtp.user","username");
prop.put("mail.smtp.password","password");


Sorry for the obvious question, but is that your real username and password that you are using and passing, or just to protect, from this forum, the actual ones?

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AutenticationFailedException
 
Similar Threads
"import package"
WSAD MailProvider
package error
java mail
how to send email through servlet using java mail API