How can I send mail to my gmail.com address using the Pony gem.
post '/contacts' do
@email = params[:email]
@messages = params[:messages]
end
I tried the one described here, but it doesn't work.
Pony.mail(
:name => params[:name],
:mail => params[:mail],
:body => params[:body],
:to => '[email protected]',
:subject => params[:name] + " has contacted you",
:body => params[:message],
:port => '587',
:via => :smtp,
:via_options => {
:address => 'smtp.gmail.com',
:port => '587',
:enable_starttls_auto => true,
:user_name => 'lumbee',
:password => 'p@55w0rd',
:authentication => :plain,
:domain => 'localhost.localdomain'
})
importantly you must configure your gmail account: activate 2 factor authorisation and set an application password. It's a bit of searching, but not complicated.
I have configured like this in
app.rb
Usage: