在块内设置delivery_method
立即delivery
而不是设置defaults
发送似乎与以下代码配合良好:
Mail.deliver do
delivery_method :smtp,
address: "smtp.gmail.com",
domain: "#####",
port: 587,
user_name: from,
password: "#####",
enable_starttls_auto: true
from from
to to
subject subject
body "default body"
end
但是我该如何做同样的阅读呢?
Mail.last do
retriever_method :imap,
user_name: to,
password: password,
address: server,
port: port,
enable_ssl: true
end
原因
*** NoMethodError Exception: undefined method `retriever_method' for #<RSpec::ExampleGroups::Nested::Nested_2::Nested::Email_2:0x00007fa246110478>