尝试使用RoR中的mailman服务器从数据库轮询多个帐户时出错

时间:2015-01-22 07:30:59

标签: ruby-on-rails mailman

您好我正在尝试使用RoR中的mailman服务器从数据库访问多个帐户。但我收到以下错误

script/mailman_server:7:in `<main>': uninitialized constant EmailConfig (NameError)

以下是我尝试完成任务的内容:

 #!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"
require "mailman"

Mailman.config.logger = Logger.new("log/mailman.log") # uncomment this if you can want to create a log fill
@email_con = EmailConfig.find_by_sql(["SELECT email_id, password FROM email_configs"])
Mailman.config.poll_interval = 3 # change this number as per your needs. Default is 60 seconds
Mailman.config.pop3 = { server: 'pop.gmail.com', 
                        port: 995, ssl: true, 
                        username: @email_con.email_id,
                        password: @email_con.password }

**Logic starts here**
Mailman::Application.run do
default do
begin
-------
end

任何想法都会感激不尽。感谢

0 个答案:

没有答案