Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java API
Search Coderanch
Advance search
Google search
Register / Login
Forums
Register
Login
Java
»
Other JSE/JEE APIs
Reading Mail from Rediff
syruss kumar
,
Ranch Hand
Jun 20, 2011 05:05:23
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
Hi all i have tried to read mail from rediffmail account
but its giving authorization failed exception
public class MailCleaner { public static void main(String[] args) { String mailHost="pop.rediffmail.com"; String userName="****"; String password="****"; Properties mailProp=System.getProperties(); /*mailProp.setProperty("mail.transport.protocol","smtp"); mailProp.setProperty("mail.host","mailHost"); mailProp.setProperty("mail.smtp.port","25"); mailProp.setProperty("mail.user",userName); mailProp.setProperty("mail.password",password);*/ Session sessionOBJ=Session.getDefaultInstance(mailProp,new MailCleanerAuthenticator(userName,password)); try { Store storeOBJ=sessionOBJ.getStore("pop3"); storeOBJ.connect(mailHost, userName, password); Folder folderOBJ=storeOBJ.getFolder("INBOX"); folderOBJ.open(Folder.READ_WRITE); Message[] message=folderOBJ.getMessages(); for (int i = 0; i < message.length; i++) { System.out.println(message[i].getFrom()); } folderOBJ.close(true); storeOBJ.close(); } catch (NoSuchProviderException e) { e.printStackTrace(); } catch (MessagingException e) { e.printStackTrace(); } } } class MailCleanerAuthenticator extends Authenticator{ private PasswordAuthentication passowrdAuth; MailCleanerAuthenticator(String username,String password){ passowrdAuth=new PasswordAuthentication(username, password); } }
please suggest me
Post by:
autobot
I brought this back from the farm where they grow the tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
This thread has been viewed 1635 times.
Similar Threads
Sending a mail from java application to exchange server
pop3 works, imap fails with No login methods supported!
how to use HTTPUrlConncection with user and password
Sending email from java. Pls Help!!!
550 Invalid recipient Problem whilst I am sending Email using SMTP
More...
All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 05:28:45
.