From: loominator1970 Date: 2008-09-04T02:09:27+09:00 Subject: Send email with attachments in Ruby I'm trying to find some code to send an email with attachment in ruby. I'm using the following code to send an email, but I would like to send an PDF. Can someone please tell me what code i need to add to include a file called "the_attachment.pdf"? Thanks, Dave ## send email require 'net/smtp' # set up the email addresses user_from = "my_email@here.com" user_to = "their_email@there.com" the_email = "From: my_email@here.com\n" + "Subject: Email with attachment\n\n" + "See attached PDF.\n\n" # handling exceptions begin Net::SMTP.start('localhost') do |smtp| smtp.send_message(the_email, user_from, user_to) end rescue Exception => e print "Exception occured: " + e end