This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund 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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply 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
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9189
    
    2


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: 35253
    
    7
This is where the @Override annotation comes in very handy. Why don't you add that to the getPasswordAuthentication method and recompile?


Android appsImageJ pluginsJava web charts
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: 35253
    
    7
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: 19216

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
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Sending a mail from java application to exchange server
 
Similar Threads
Encountering SMTPSendFailedException with SendMailServlet
sending mail with JavaMail
Sending mail with authentication to Exchange Server 2007
send email using gmail account
Java Mail