imap
imap
A very much WIP imap library for crystal.
Installation
Add this to your application's shard.yml
:
dependencies:
imap:
github: crisward/imap
Usage
require "imap"
imap = Imap::Client.new(host: "imap.gmail.com", port: 993, username: "email@gmail.com", password: "*******")
mailboxes = imap.list
if mailboxes.size > 0
mailbox = mailboxes[0]
imap.select(mailbox)
status = imap.status(mailbox, ["MESSAGES", "UNSEEN"])
puts "There are #{status["MESSAGES"]} message in #{mailbox} #{status["UNSEEN"]} unread."
end
imap.close
Testing
Need to start writing tests.
- https://github.com/ruby/ruby/tree/ruby_2_4/test/net/imap for inspiration
- https://github.com/tedious/DovecotTesting
Contributing
- Fork it ( https://github.com/crisward/imap/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- crisward Cris Ward - creator, maintainer
Repository
imap
Owner
Statistic
- 13
- 3
- 0
- 0
- 0
- about 7 years ago
- August 29, 2017
License
MIT License
Links
Synced at
Fri, 22 Nov 2024 03:30:07 GMT
Languages