我正在 Sinatra 中创建一个表单,该表单将在使用 Pony gem 提交时将数据发送到电子邮件。到目前为止,这是我的代码:
post '/pemco' do
Pony.mail(
:from => params[:name] + "<" + params[:email] + ">",
:to => '___@yandex.ru',
:subject => params[:name] + " has contacted you",
:body => params[:message],
:via => :smtp,
:via_options => {
:address => 'smtp.yandex.ru',
:port => '465',
:enable_starttls_auto => true,
:user_name => '___',
:password => '___',
:authentication => :plain
})
redirect '/'
end
我按下submit,响应等待一段时间,然后我得到Net::ReadTimeout file: protocol.rb location: rescue in rbuf_fill line: 158错误。我究竟做错了什么?