DetectEmailSettings
This gem is intended to detect email settings for use with Mikel Lindsaar's mail gem. The idea is that a user can give your site their email address and password and the correct connection settings will be auto-detected.
Installation
Add this line to your application's Gemfile:
gem 'detect_email_settings'
And then execute:
$ bundle
Or install it yourself as:
$ gem install detect_email_settings
Usage
To guess detect email settings for all possible mail servers. This
process can take up to 10 minutes for some server configurations and is
not guaranteed to work. If you need faster service you may consider
using C
settings = DetectEmailSettings.detect_settings('[email protected]', 'password')
if settings.nil?
puts "Couldn't detect email settings."
else
Mail.defaults do
retriever_method settings[:method],
:address => settings[:address],
:port => settings[:port],
:user_name => settings[:user_name],
:password => settings[:password],
:enable_ssl => settings[:enable_ssl]
end
end
You will get almost immediate results using C
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request