This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Java in General and the fly likes Sending a mail from java application to exchange server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Sending a mail from java application to exchange server" Watch "Sending a mail from java application to exchange server" New topic
Author

Sending a mail from java application to exchange server

srikanth arroju
Ranch Hand

Joined: Aug 02, 2006
Posts: 66
Hello All,

Im trying to send mail through a java application


but it is throwing an exception
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17


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...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
srikanth arroju
Ranch Hand

Joined: Aug 02, 2006
Posts: 66
for post i have changed the values.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42046
    
  64
This is where the @Override annotation comes in very handy. Why don't you add that to the getPasswordAuthentication method and recompile?


Ping & DNS - my free Android networking tools app
srikanth arroju
Ranch Hand

Joined: Aug 02, 2006
Posts: 66
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
Marshal

Joined: Mar 22, 2005
Posts: 42046
    
  64
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

Joined: Oct 27, 2005
Posts: 19697
    
  20

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


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
GeeCON Prague 2014
 
subject: Sending a mail from java application to exchange server