Thanks . I will write the code around and get it working.
For subfolders, actually inside Inbox, there are sub folder where specific mails are getting collected based on the policy/rules. That is the reason i need to get the mails from subfolder, but let me try it out. thanks bhavesh On Apr 25, 9:15 am, Željko Filipin <[email protected]> wrote: > Comments are inline. > > On Wed, Apr 25, 2012 at 5:57 PM, Bhavesh <[email protected]> wrote: > > I think you are on vacation Yesterday, otherwise i could have done it > > yesterday. > > Not on vacation, just really busy. :) > > > If i use "mail" gem, then when i try to access new unread email, it > > fails, it always returns first mail whether it is read or unread. > > As far as I remember, when you get mail via POP3 (as you are doing) there > is no way to mark an e-mail message as read. You can just download it and > delete it. You should use IMAP if you want to mark message as read. > > > 1. How can I get all the unread emails ? > > Looks like this should do it: > > Mail.all > > More info: > > http://rubydoc.info/gems/mail/Mail/IMAPhttp://rubydoc.info/gems/mail/Mail/POP3 > > > 2. How can I get all links that are present inside emails? > > I do not think mail gem provides that functionality. > > > or mail message body from the email? > > mail.body.decoded > > More info: > > https://github.com/mikel/mail > > > 3. Can I click Links present inside an email? [This i can do once > > i have an link] > > No, but you can save a link in a variable and than open the page with > Watir. You have to understand that mail gem and watir gem are really > focused. Mail gem just reads, sends and receives mail, does not know > anything about browsers or links. Watir gem just drives browsers, does not > know anything about e-mail. > > > 4. How can I get emails from a specific folder, if I have > > subfolders? > > Do you want to access e-mail messages on a server, or on your local machine? > > Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
