rails smtp config

来源:互联网 发布:php中把数组炸开 编辑:程序博客网 时间:2024/06/06 02:25
    config.action_mailer.delivery_method = :smtp
    config.action_mailer.perform_deliveries = true
    config.action_mailer.smtp_settings = {
      address:              'smtp.126.com',
      port:                     '25',
      domain:                '126.com',
      user_name:           'example@126.com',
      password:             'xxxx',
      authentication:       "plain",
      enable_starttls_auto:  true,
      openssl_verify_mode:   OpenSSL::SSL::VERIFY_NONE

    }


然后 default from 一定与 user_name  一致 

class SendMail  < ActionMailer::Base

    default from: "example@126.com"

     # do something

 end


原创粉丝点击