@@ -144,13 +144,15 @@ I have tried to simplify it some:
144
144
145
145
## Contributing
146
146
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.
148
148
149
149
## Usage
150
150
151
151
All major mail functions should be able to happen from the Mail module.
152
152
So, you should be able to just <code >require 'mail'</code > to get started.
153
153
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
+
154
156
### Making an email
155
157
156
158
``` ruby
@@ -284,19 +286,29 @@ mail.delivery_method :logger
284
286
mail.delivery_method :logger , logger: other_logger, severity: :debug
285
287
```
286
288
287
- ### Getting Emails from a POP Server:
289
+ ### Getting Emails from a POP or IMAP Server:
288
290
289
291
You can configure Mail to receive email using <code >retriever_method</code >
290
292
within <code >Mail.defaults</code >:
291
293
292
294
``` ruby
295
+ # e.g. POP3
293
296
Mail .defaults do
294
297
retriever_method :pop3 , :address => " pop.gmail.com" ,
295
298
:port => 995 ,
296
299
:user_name => ' <username>' ,
297
300
:password => ' <password>' ,
298
301
:enable_ssl => true
299
302
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
300
312
```
301
313
302
314
You can access incoming email in a number of ways.
0 commit comments