【发布时间】:2017-10-15 23:45:06
【问题描述】:
我正在尝试从 rails 发送电子邮件并使用 Thunderbird 捕获它。
这是我的邮件:
def hello_world
from = 'bruno@localhost'
subject = 'Hello World'
to = 'bruno@localhost'
main to: to, from: from, subject: subject
end
我按照这个说明在本地配置了 Thunderbird,它工作正常。 https://gist.github.com/raelgc/6031274
我不确定如何配置 rails。
我应该在 development.rb 中放什么?
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "localhost",
:port => 25,
:domain => "localhost"
}
【问题讨论】:
-
是的,你应该把它放在 development.rb 中,尽管它必须是 Thunderbird 吗?试试这个mailcatcher.me