Results 1 to 3 of 3
- 04-30-2008, 10:42 AM #1
Member
- Join Date
- Apr 2008
- Posts
- 3
- Rep Power
- 0
urgent help -java mail authorization failed exception
hi all,
i am developing a feedback form that takes user feed back and send an email to the concerned person. but there is a exception:
Exception:
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: use8bit false
MAIL FROM:<confused.hell@gmail.com>
530-5.5.1 Authentication Required. Learn more at
530 5.5.1 My client isn't accepting my username and password 30sm1751526w ff.8
com.sun.mail.smtp.SMTPSendFailedException: 530-5.5.1 Authentication Required. Le arn more at
530 5.5.1 My client isn't accepting my username and password 30sm1751526w ff.8
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(S MTPTransport.java:1 388)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTrans port.java:959)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTr ansport.java:583)
at com.khushiiit.feedback.core.Mail.sendMail(Mail.jav a:63)
at com.khushiiit.feedback.core.MailServlet.doGet(Mail Servlet.java:31)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:114)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:91)
at com.caucho.server.dispatch.ServletFilterChain.doFi lter(ServletFilterC hain.java:103)
at com.caucho.server.webapp.WebAppFilterChain.doFilte r(WebAppFilterChain .java:181)
at com.caucho.server.dispatch.ServletInvocation.servi ce(ServletInvocatio n.java:266)
at com.caucho.server.http.HttpRequest.handleRequest(H ttpRequest.java:269 )
at com.caucho.server.port.TcpConnection.run(TcpConnec tion.java:603)
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPoo l.java:721)
at com.caucho.util.ThreadPool$Item.run(ThreadPool.jav a:643)
at java.lang.Thread.run(Thread.java:595)
exception : com.sun.mail.smtp.SMTPSendFailedException: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 My client isn't accepting my username and password 30sm1751526w ff.8
Code:
Properties properties = new Properties();
properties.load(this.getClass().getResourceAsStrea m("resource.properties"));
String user = properties.getProperty("mail.smtp.user");
String password = properties.getProperty("mail.smtp.password");
Authenticator authenticator = new SMTPAuthenticator(user, password);
Session session = Session.getDefaultInstance(properties, authenticator);
session.setDebug(true);
MimeMessage msg = new MimeMessage(session);
InternetAddress addressFrom = new InternetAddress(user);
msg.setFrom(addressFrom);
InternetAddress[] addressTo = new InternetAddress[email.length];
for (int i = 0; i < email.length; i++) {
addressTo[i] = new InternetAddress(email[i].trim());
}
msg.setRecipients(Message.RecipientType.TO, addressTo);
msg.setSubject(subject);
msg.setContent(data, "text/plain");
tr = session.getTransport("smtp");
tr.connect("smtp.gmail.com",user, password);
msg.saveChanges();
tr.sendMessage(msg, msg.getAllRecipients());
tr.close();
one more thing i want to say is that this exception occur when i used resin 3.1.5 as servlet container.
when i run this code in netbeans ide using glassfish as servlet conatiner , my code just work fine .
please get me out of this mess .
thanx in advanced
- 04-30-2008, 10:45 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Ah, you ask it again. :)
Anyway, I'm interesting on this. You say that on one IDE it's work but not in another, basically.
Can't you test the same code in resin later version?
- 04-30-2008, 11:27 AM #3
Member
- Join Date
- Apr 2008
- Posts
- 3
- Rep Power
- 0
thnax for u'r reply
but i am using the latest version of resin and even tried other too.
i think this is not related to version but seems like i am missing some information regarding setting that force gmail to authorized me but can't point out that one exactly.........
:confused:
or might be missing some code that make me authorized...
plz help
waiting for u'r reply
thanx:confused:
Similar Threads
-
java.net.SocketException: Permission denied: listen failed
By vitaliy in forum NetworkingReplies: 3Last Post: 05-22-2011, 03:16 PM -
Java failed to reach to a PC in local LAN
By JavaEmpires in forum NetworkingReplies: 1Last Post: 01-24-2008, 06:30 PM -
Exception Failed to Generate Wrapper Class on WebLogic
By christina in forum New To JavaReplies: 1Last Post: 08-07-2007, 02:15 AM -
Java mail api exception
By oregon in forum New To JavaReplies: 1Last Post: 08-05-2007, 06:03 PM -
Sending a mail with the local mail program
By thedude in forum Advanced JavaReplies: 2Last Post: 07-23-2007, 12:19 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks