Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending a mail from java application to exchange server

 
srikanth arroju
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

Im trying to send mail through a java application


but it is throwing an exception
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Have you explicitly set these values like this when you posted the code here or are you actually using these values?? The error says that your username, password is not correct...
 
srikanth arroju
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for post i have changed the values.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is where the @Override annotation comes in very handy. Why don't you add that to the getPasswordAuthentication method and recompile?
 
srikanth arroju
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have added @override annotation to the method


but it is throwing a compiler error



The method getPasswordAuthentication(String, String) of type SendMailExchange.SMTPAuthenticator
must override or implement a supertype method

 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That tells you that the method which you thought was overriding some other method does not, in fact, do that. Now: how do you find out what the method should look like instead, so that it *does* override some other method?
 
Rob Spoor
Sheriff
Pie
Posts: 20532
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's exactly what Ulf meant - you have not overridden the method but overloaded it instead. Check the correct signature in the Javadocs: javax.mail.Authenticator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic