Sending email with attachments


Could anyone please give an example of sending mails with attachments in
rails using actionmailer?
I have a user in users table whose attachments is stored in
attachments table it self( Relation is user has_many attachments ;
attachment belongs_to user). Sender for example is [email protected].
suppose user1 has two attachments “test1.pdf” and “test2.doc”


A detailed requirement of the above is as

I have a message model, message_participant model, and attachments
model. The relations are

message has_many message_participants
message has_many attachments

attachment using paperclip I am storing in database it self. I have
in hand a message object which has subject, body etc. So clearly this
message has a sender and many recipients. This I can find out. My
requirement is to send each of the message recipients this message with
its attachments

I have all the data in my hand . What I need is, to send same email
with attachments to the recipients

Please help