[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: TMail-question

Dan Fitzpatrick

6/8/2005 5:35:00 PM


Johann Spies wrote:
>
> How do I access the individual parts of a multipart message using
> TMail?
>
> The documentation says:
>
> body -> String
> preamble -> String
>
> the mail body. If the mail is a MIME multipart mail, this
> attribute represents "preamble".
>
>
> I need to access the first body of a multipart message but I do not
> understand how to do it.
>
> Looking at message.parts.public_methods I could not find one which
> returns the body of a spesific part.
>
> Any pointers would be welcome please.
>
> Regards
> Johann
>

Johann,

This is how I do it:

message = TMail::Mail.load(message_file)
message.parts[0] # The first part

Dan