0
Rails 2.3.11使用ActionMailer時出現錯誤「from」電子郵件
我試圖在用戶註冊時發送激活樣式的電子郵件。電子郵件成功發送,但發送錯誤的「發件人」電子郵件地址。主題,內容和收件人的電子郵件都很好。激活@ [domain] .net而不是從發送,它們來自[登錄名] @ box570.bluehost.com。
/app/models/franklin.rb:
@user = User.create(
:first_name => params[:first_name],
:last_name => params[:last_name],
:email => params[:email],
:password => params[:password],
:password_confirmation => params[:password_confirmation],
:user_class => "User"
)
Franklin.deliver_activation(@user)
/config/environments/development.rb:
調用它的控制裝置的適用部分:
# Settings specified here will take precedence over those in config/environment.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.action_controller.consider_all_requests_local = true
config.action_view.debug_rjs = true
config.action_controller.perform_caching = false
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :sendmail
謝謝!