![]() |
new PasswordAuthentication class error
i have this code for sending mail.i am using netbean and it shows an error on line
Code:
return new PasswordAuthentication("matumiziyangu@gmail.com",password.toCharArray());the error says "incompatible types required: javax.mail.PasswordAuthentication found: java.net.PasswordAuthentication" below is the source code. Code:
Properties props = new Properties(); |
This line is wrong:
return new PasswordAuthentication("matumiziyangu@gmail.com",password.toCharArray());. According to the javax.mail documentation in JEE, this constructor is signatured with PasswordAuthentication(String, String). java.net.PasswordAuthentication on the other hand is signatured with PasswordAuthentication(String, char[]).Since you don't have a FQN for the PasswordAuthentication and the error doesn't appear to be a missing class, this indicates that you have an import for java.net.PasswordAuthentication, when you should be using javax.mail.PasswordAuthentication. Either alter the import (if nothing else requires it), or modify this new call the javax.mail.PasswordAuthentication. |
| All times are GMT +1. The time now is 05:25 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.