【问题标题】:Rail Actionmailer configuration with blue host使用 bluehost 配置 Rails Actionmailer
【发布时间】:2013-02-20 05:53:57
【问题描述】:

我正在使用 rails 3.2.11 并使用蓝色主机作为我的电子邮件服务器来发送电子邮件。

下面是我在 development.rb 中的配置信息

   config.action_mailer.smtp_settings = {

    :address              => "box75112.bluehost.com",

    :port                 => "465",
    :domain               => "bluehost.com",

    :enable_starttls_auto => true,
    :authentication       => :login,
    :user_name            => "support@buddy.io",
    :password             => "93utitrpppJvZ,[#4rl4"

}

这些是我的蓝色主机信息

      Mail Server Username: support+buddy.io
      Incoming Mail Server: mail.buddy.io
      Incoming Mail Server: (SSL) box75112.bluehost.com
      Outgoing Mail Server: mail.buddy.io (server requires authentication) port 26
      Outgoing Mail Server: (SSL) box75112.bluehost.com (server requires authentication) port 465

      Supported Incoming Mail Protocols: POP3, POP3S (SSL/TLS), IMAP, IMAPS (SSL/TLS)
      Supported Outgoing Mail Protocols: SMTP, SMTPS (SSL/TLS) 

但是邮件没有发出,也没有错误

有人可以帮忙吗?

谢谢

【问题讨论】:

    标签: ruby-on-rails-3.2 actionmailer bluehost


    【解决方案1】:

    如果仍然派上用场。你可以使用 ssl,试试这样:

     config.action_mailer.delivery_method = :smtp
      config.action_mailer.default_url_options = { :host => 'example.com' }
      config.action_mailer.raise_delivery_errors = true
      # Send email in development mode?
      config.action_mailer.perform_deliveries = true
    
      config.action_mailer.smtp_settings = {
          address: "server.example.com",
          port: 465,
          enable_starttls_auto: true,
          ssl: true,
          domain: 'example.com',
          user_name: 'user@example.com',
          password: 'MyPassWorD',
          authentication: :plain
      }
    

    在 Bluehost 上为我工作。

    【讨论】:

      【解决方案2】:

      我已经成功地使用 ActionMailer 与 BlueHost SMTP 服务器建立了非加密连接:

      config.action_mailer.smtp_settings = {
          address:              => "mail.buddy.io",
          port:                 => 26,
          enable_starttls_auto: => false,
          authentication:       => "plain",
          user_name:            => "support+buddy.io",
          password:             => "password"
      }
      

      注意user_name 与电子邮件地址不同。并且不需要domain 参数。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2010-10-22
        • 1970-01-01
        • 2014-05-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多