• Post Reply Bookmark Topic Watch Topic
  • New Topic

In JavaMail  RSS feed

 
Marimuthu Udayakumar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all.
please help me,while sending mail using java mail that i got "javax.mail.AuthenticationFailedException" ,i am trying as past 2 days. i am not able to find answer....




boolean debug = false;
String recipientEmail = "teknoturfian@gmail.com";
String subject = "How to reset your password";
String message = " This is message ";
String from = "marimu@yahoo.com";
String mailSmtpHost ="gmail.com";





Properties prob = new Properties();

prob.put("mail.transport.protocol", "smtp");
prob.put("mail.smtp.host", mailSmtpHost);
prob.put("mail.smtp.socketFactory.port", 25);
prob.put("mail.smtp.starttls.enable","true"); //
prob.put("mail.smtp.auth", "true");
prob.put("mail.smtp.port", 25);


Session session = Session.getInstance(prob);

session.setDebug(debug);

Message msg = new MimeMessage(session);

InternetAddress addressFrom = new InternetAddress(from);
msg.setFrom(addressFrom);

InternetAddress res = new InternetAddress(recipientEmail);
msg.setRecipient(Message.RecipientType.TO, res);
msg.setSubject(subject);
msg.setContent(message,"text/plain");
Transport tr = session.getTransport("smtp");
tr.connect(mailSmtpHost,"XXXX", "XXX");

msg.saveChanges(); //
tr.send(msg);
tr.close();
[ December 22, 2008: Message edited by: marimuthu udaya ]
 
Rob Spoor
Sheriff
Posts: 21052
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is the user authentication part?
 
Vinoth Thirunavukarasu
Ranch Hand
Posts: 164
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The user authentication part and fill coding is available at http://www.hiox.org/bypass/index.php?id=785 just copy and run the code.

Regards,
Vinoth.
[ December 22, 2008: Message edited by: vinoth thirunavukarasu ]
 
Rob Spoor
Sheriff
Posts: 21052
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try putting two more properties in your Properties object:
 
Marimuthu Udayakumar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have implemented which you given code, again it shows below exceptions......

" javax.mail.AuthenticationFailedException"
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!