2013-04-02 17 views
0

我嘗試發送郵件使用Ruby on Rails的郵寄,但代碼中的消息不傳送到電子郵件-ruby上rails-

mail(:to => user.email, :subject => "Welcome to My site") 

CON

ActionMailer::Base.smtp_settings = { 
:address    => "smtp.gmail.com", 
    :port     => 587, 
    :domain    => "gmail.com", 
    :user_name   => "username", 
    :password    => "password", 
    :authentication  => "plain", 
    :enable_starttls_auto => true 
    } 
    RegistedMailer.sendingmail(@profolio).deliver 
並不傳遞 雖然0錯誤

note 本地主機上的應用程序代理

回答

0

傳送方式的設置是什麼?它應該是:

config.action_mailer.delivery_method = :smtp 
+0

新錯>>沒有這樣的文件或目錄 -/usr/sbin/sendmail -i -t -f – engineer

0

在開發模式下,Rails不發送電子郵件。請確保您設置此,per the Rails Guides Action Mailer Configuration for GMail頁:

config.action_mailer.delivery_method = :smtp 

如果已設置,可您發佈的日誌?

您可能還想調查something like MailCatcher,這可以更容易地在開發模式下測試電子郵件。

+0

謝謝> $ RAILS_ENV.rb是什麼意思? – engineer

+0

$ RAILS_ENV是指「Rails環境」。有三個開箱:開發,測試和生產。因此,在開發環境中,您可以編輯'development.rb'文件。 –

相關問題