2017-08-29 98 views
-3

我想发送邮件使用dreamhost凭证与红宝石在铁轨上。邮件发送问题使用Dreamhost与红宝石在铁轨上

我的development.rb文件邮件设置如下。

config.action_mailer.smtp_settings = { 
    address: "dreamhost.com", 
    port: 587, 
    domain: "www.dreamhost.com", 
    authentication: "plain", 
    enable_starttls_auto: true, 
    user_name: ENV['mailer'], 
    password: ENV['mailer_password'] 
} 

邮件无法使用上面的邮件配置我收到错误,如errno的:: ECONNREFUSED发送(连接被拒绝的“dreamhost.com”端口587)。

任何人都可以帮我解决这个问题吗?

+0

什么问题?你需要提供更多的细节给任何人来帮助你。 –

+0

我没有得到确切的问题。我已经在config/development.rb文件中添加了邮件凭据和域设置。当我使用dreamhost凭证发送邮件时,我不确定我必须添加到地址和域中。 – Pooja

回答

0

这是我的个人资料我Dreamhost上

使用
config.action_mailer.perform_caching = false 

    # Ignore bad email addresses and do not raise email delivery errors. 
    # Set this to true and configure the email server for immediate delivery to raise delivery errors. 
    config.action_mailer.raise_delivery_errors = false 

    config.action_mailer.delivery_method = :smtp 
    config.action_mailer.default_options = {from: '[email protected]'} 
    config.action_mailer.smtp_settings = { 
    address:    'sub5.mail.dreamhost.com', 
    port:     587, 
    domain:    'mywebsite.org', 
    user_name:   '[email protected]', 
    password:    'mypassword', 
    authentication:  :login, 
    enable_starttls_auto: false } 

注意sub5.mail.dreamhost.com是你datacenter server依赖于域的地址。

注意:密码应该隐藏到ENV variables or other external file outside version control