Skip to content

Commit 8471b01

Browse files
fwolfstjeremy
authored andcommitted
Improve IMAP documentation in README (#1367)
* Include IMAP fetching example in README . * include link to rendered rdoc/yard at rubydoc.info * link CONTRIBUTING.md from README
1 parent f5801f2 commit 8471b01

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

README.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,15 @@ I have tried to simplify it some:
144144

145145
## Contributing
146146

147-
Please do! Contributing is easy in Mail. Please read the CONTRIBUTING.md document for more info
147+
Please do! Contributing is easy in Mail. Please read the [CONTRIBUTING.md](CONTRIBUTING.md) document for more info.
148148

149149
## Usage
150150

151151
All major mail functions should be able to happen from the Mail module.
152152
So, you should be able to just <code>require 'mail'</code> to get started.
153153

154+
`mail` is pretty well documented in its Ruby code. You can look it up e.g. at [rubydoc.info](https://www.rubydoc.info/gems/mail).
155+
154156
### Making an email
155157

156158
```ruby
@@ -284,19 +286,29 @@ mail.delivery_method :logger
284286
mail.delivery_method :logger, logger: other_logger, severity: :debug
285287
```
286288

287-
### Getting Emails from a POP Server:
289+
### Getting Emails from a POP or IMAP Server:
288290

289291
You can configure Mail to receive email using <code>retriever_method</code>
290292
within <code>Mail.defaults</code>:
291293

292294
```ruby
295+
# e.g. POP3
293296
Mail.defaults do
294297
retriever_method :pop3, :address => "pop.gmail.com",
295298
:port => 995,
296299
:user_name => '<username>',
297300
:password => '<password>',
298301
:enable_ssl => true
299302
end
303+
304+
# IMAP
305+
Mail.defaults do
306+
retriever_method :imap, :address => "imap.mailbox.org",
307+
:port => 993,
308+
:user_name => '<username>',
309+
:password => '<password>',
310+
:enable_ssl => true
311+
end
300312
```
301313

302314
You can access incoming email in a number of ways.

0 commit comments

Comments
 (0)