I am trying to send email with attachments using Ruby on Rails. I followed the instructions from the ActionMailer site.
def welcome(recipient)
@account = recipient
attachments['file.csv'] = File.read('/path/to/users.csv')
mail(:to => recipient,
:bcc => ["[email protected]", "[email protected]"],
:subject => "Sending attachment")
end
I am able to receive emails but without the attachment, I am trying to attach csv file but I am getting a file called "noname" as attachment