私のActionMailer設定ファイルにはこれがあります:
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "mail.foo.com",
:port => 25,
:domain => "foo.com",
:authentication => :email,
:user_name => "no-reply@foo.com",
:password => "foo1234567"
}
この構成では、no-reply@foo.com
メールアドレスからのみメールを送信できますか?もしそうなら、他のアドレスからメールを送信する方法はありますか?ActionMailerクラスにこれがあります:
class Notifications < ActionMailer::Base
def answered_question(faq)
subject 'Your question has been answered'
recipients faq.email
from 'Foo <no-reply@foo.com>'
sent_on Time.now
content_type "text/html"
body :faq => faq
end
def completed_order(order)
subject 'Your order has been completed'
recipients order.email
from 'Foo <registrations@foo.com>'
sent_on Time.now
content_type "text/html"
body :order => order
end
end
開発ではすべてが正常に機能しますが、本番completed_order
環境では電子メールは送信されません。
ありがとう。