Sinatra で作成した連絡フォームを使用してメールを送信できません。私はポニーの宝石を使用しています。何らかの理由で、「そのようなファイルは存在しません - which sendmail」というエラーが表示されます。「sendmail」をインストールしましたが、まだ同じ問題が発生しています。私はどんな提案にもオープンです。コードは以下のとおりです。
お問い合わせフォーム
<form action='/' id='contact' name='contact' method='post' novalidate='novalidate' >
<div class="form-group">
<div class="input-wrap">
<input type="text" class='form-control' name='name' id='name' placeholder='NAME'>
</div>
<br>
<div class="input-wrap">
<input type="email" class='form-control' name='mail' id='mail' placeholder='EMAIL'>
</div>
<br>
<div class="input-wrap">
<input type="text" class='form-control' name='subject' id='subject' placeholder='SUBJECT'>
</div>
<br>
<div class="input-wrap">
<textarea placeholder='MESSAGE' class='form-control' name="body" id="body" cols="30" rows="10"></textarea>
</div>
<br>
<input type='submit' value='SEND' id='button'>
</div>
</form>
main.rb
require 'rubygems'
require 'sinatra'
require 'bundler/setup'
get '/' do
File.read('index.html')
end
post '/' do
require 'pony'
name = params[:name]
mail = params[:mail]
subject = params[:subject]
body = params[:body]
Pony.mail(:to => 'mjstokes1986@att.net', :from => '#{name}', :subject => '#{subject}', :body => '#{body}')
# File.read('index.html')
redirect '/success'
end
get '/success' do
File.read('success.html')
end