Forum: Ruby Edit msg files with ruby

F821ef13e9d7fcbb6b746aa70b37cca0?d=identicon&s=25 Daniel Ritter (spellsleeper)
on 2017-04-03 15:45
Hi, I try to customize many msg files. I wan't convert them with an
application. but there's the problem many of the mails have a
unconvential message class the application can't handle. I wan't set the
default message class for all msg files. With 'ruby-msg' I can read all
properties like that:
-----
require 'mapi/msg'
msg=Mapi::Msg.open('C:\Users\***.MSG')
h=Hash[t.keys.zip(t.values)]
h.each_key do |k|
  puts "#{k.to_s}:\t#{h[k].to_s}"
end
-----
That works! But I found no way to write to change mail properties like
here.
-----
require 'mapi/msg'
msg=Mapi::Msg.open('C:\Users\***.MSG')
msg=msg.properties.raw.add_property('message_class','IPM.Note')
f=File.open('C:\Users\**.MSG','w')
f.write(msg)
-----
That doesn't work. Is somebody knowing a way to accomplish this? All
possible solutions are welcome:)!
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.