E
Emiliano Vavassori
Hi all,
first post here, hope to ask things the right way
I'm using Ruby from RubyInstaller, 1.9.1-p243. I'm trying to send a .txt
file (which notepad++ says it's Dos/Windows with ANSI encoding) via
email using something like:
content = File.read(filename)
enccont = [content].pack('m')
Then inserting enccont inside a heredoc containing the whole mail to
send, like:
message =<<EOMESS
...
#{enccont}
...
EOMESS
The results are that I receive a mail that lacks of the 'end of lines',
in which place there are little squares (one per each line, to be fair).
Also, filetype is Unix (and not Dos/Windows).
I tried previously to substitute \n with \r\n:
content = File.read(filename).gsub(/\n/, '\r\n')
but the results are worse than before (\r\n appears also in the
attachment).
I would like to obtain the same file also via email. Is that possible?
Is there someone which has some ideas on how to achieve that?
Thanks, regards,
first post here, hope to ask things the right way
I'm using Ruby from RubyInstaller, 1.9.1-p243. I'm trying to send a .txt
file (which notepad++ says it's Dos/Windows with ANSI encoding) via
email using something like:
content = File.read(filename)
enccont = [content].pack('m')
Then inserting enccont inside a heredoc containing the whole mail to
send, like:
message =<<EOMESS
...
#{enccont}
...
EOMESS
The results are that I receive a mail that lacks of the 'end of lines',
in which place there are little squares (one per each line, to be fair).
Also, filetype is Unix (and not Dos/Windows).
I tried previously to substitute \n with \r\n:
content = File.read(filename).gsub(/\n/, '\r\n')
but the results are worse than before (\r\n appears also in the
attachment).
I would like to obtain the same file also via email. Is that possible?
Is there someone which has some ideas on how to achieve that?
Thanks, regards,