尝试从 Ruby on Rails 发送电子邮件,但得到以下信息:
SocketError in UsersController#create
getaddrinfo: nodename nor servname provided, or not known
我的环境/development.rb 文件有:
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: "my_company.org",
authentication: "plain",
enable_starttls_auto: true,
user_name: "my_username@my_company.org",
password: "my_pass"
}
和
config.action_mailer.delivery_method = :smtp
和
config.action_mailer.default_url_options = { :host => 'localhost:5000' }
# 5000 rather than 3000 as I am using foreman.