This is a sample app showing how to fetch and parse emails using mailman gem. https://github.com/titanous/mailman
¶ ↑
How to run this application-
At the command prompt, clone this app:
<tt>git clone git@github.com:mohitjain/mailman_example_code.git</tt>
-
Change directory to
mailman_example_code
and run the bundler, database create and migrate and start server:<tt>cd mailman_example_code; bundle install; rake db:create; rake db:migrate; rails s</tt>
-
Go to localhost:3000/messages to see the list of messages been fetched:
-
Go to scripts/mailman_server file and change your gmail username and password in order to test the application.
-
Run mailman server by running scripts/mailman_server command
-
Send an email to email specified in the script/mailman_server file and you can see new messages at localhost:3000/messages. Attachments are also handled properly in this demo app.
-
Contact me in case you have any issues. link: www.codebeerstartups.com/contact/
¶ ↑
See a blog post on the same code-
More information about this application can be found at:
http://www.codebeerstartups.com/2013/01/how-to-fetch-and-parse-emails-in-ruby-on-rails/