Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-30-2008, 12:42 PM
Member
 
Join Date: Apr 2008
Posts: 3
ravinder.kadiyan is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-30-2008, 12:45 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
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?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Someone helped you?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.
Help:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Resources:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Web:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Tips:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-30-2008, 01:27 PM
Member
 
Join Date: Apr 2008
Posts: 3
ravinder.kadiyan is on a distinguished road
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.........

or might be missing some code that make me authorized...

plz help

waiting for u'r reply

thanx
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java failed to reach to a PC in local LAN JavaEmpires Networking 1 01-24-2008 08:30 PM
Exception Failed to Generate Wrapper Class on WebLogic christina New To Java 1 08-07-2007 04:15 AM
Java mail api exception oregon New To Java 1 08-05-2007 08:03 PM
Sending a mail with the local mail program thedude Advanced Java 2 07-23-2007 02:19 PM
java.net.SocketException: Permission denied: listen failed vitaliy Networking 2 07-09-2007 01:20 PM


All times are GMT +3. The time now is 12:26 PM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org