Here is the code I tried
a = [1,2,3,4,5]
require 'net/smtp'
message = <<MESSAGE_END
From: Private Person <me@fromdomain.com>
To: A Test User <test@todomain.com>
Subject: Something
"#{a}" This is a test e-mail message.
MESSAGE_END
Net::SMTP.start('localhost') do |smtp|
smtp.send_message message, 'me@fromdomain.com',
'test@todomain.com'
end
I have figured a way around this
message =%Q(
Subject: Test suite result
#{a}
)
smtp = Net::SMTP.new 'smtp.gmail.com', 587
smtp.enable_starttls
smtp.start('smtp.gmail.com', 'from@mail.com', 'password', :plain) do |smtp|
smtp.send_message message, 'from@mail.com',
'to@mail.com'
end
But if I use above approach I am only able to send the body and cannot send subject and the to address.