I am new to Pony. In my sinatra application I am sending mail by using Pony. But the problem I am facing with sending multiple csv files as attachments. In mail I am getting only one file noname.csv with content of all the files. But I don't want it, I want all the files comes attached separately. I have written the code as follows:
def send_mail(file1, file2) do
Pony.mail(
:from => "mailer@abc.com",
:to => "joy@abc.com",
:subject => "text",
:content_type => "text/csv",
:via => :smtp,
:via_options => {
:address => "abc.com",
:port => 587,
:user_name => "test",
:password => "test123",
:authentication => plain ,
:domain => "abc.com",
:enable_starttls_auto => true},
:attachments => {"a.csv" => File.read("#{settings.root}"+"/"+"#{file1}"),"b.csv"=>File.read("#{settings.root}"+"/"+"#{file2}")}
end