V
Vetrivel Vetrivel
How to attach the filename in ruby. I have attach 1.txt as a file name .
The 1.txt
file has the following contents.
This is a test message.
But it doesn't work for me.
require 'net/smtp'
msgstr = <<END_OF_MESSAGE
From: FromAddress
To: ToAddress
Subject: test message
Message-Id: <[email protected]>
attachment: "1.txt"
END_OF_MESSAGE
smtp = Net::SMTP.start("IpAdd" , portno)
smtp.send_message msgstr, 'fromAddress, 'toAddress'
The 1.txt
file has the following contents.
This is a test message.
But it doesn't work for me.
require 'net/smtp'
msgstr = <<END_OF_MESSAGE
From: FromAddress
To: ToAddress
Subject: test message
Message-Id: <[email protected]>
attachment: "1.txt"
END_OF_MESSAGE
smtp = Net::SMTP.start("IpAdd" , portno)
smtp.send_message msgstr, 'fromAddress, 'toAddress'