Ruby Requires Chilkat v11.0.0+
Ruby
Read To and Cc from a received message
See more Email Object Examples
Enumerate visible recipients by zero-based index. An address can have an empty display name. A delivered copy usually does not reveal recipients who were blind-copied.
Chilkat Ruby Downloads
require 'chilkat'
success = false
# Assumes Chilkat is unlocked. See Global Unlock Sample.
email = Chilkat::CkEmail.new()
success = email.LoadEml("message.eml")
if (success != true)
print email.lastErrorText() + "\n";
exit
end
i = 0
while (i < email.get_NumTo())
print "To: " + email.getToName(i) + " " + email.getToAddr(i) + "\n";
i = i + 1
end
i = 0
while (i < email.get_NumCC())
print "Cc: " + email.getCcName(i) + " " + email.getCcAddr(i) + "\n";
i = i + 1
end