Created
March 4, 2010 17:29
-
-
Save leepfrog/321928 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >> a=File.open("testmsg.emlx") | |
| => #<File:testmsg.emlx> | |
| >> mail=TMail::Mail.parse(a.read) | |
| => #<TMail::Mail port=#<TMail::StringPort:id=0x8525896c> bodyport=nil> | |
| >> mail.body | |
| => "This E-mail was sent from (Aficio MP C2050)\nAttachment: 20100209163759213.pdf\n" | |
| >> mail.body+="testing" | |
| => "This E-mail was sent from (Aficio MP C2050)\nAttachment: 20100209163759213.pdf\ntesting" | |
| >> mail.body | |
| => "" | |
| # --- | |
| # Solved! | |
| # --- | |
| # This is kinda hoakey.. but it's how tmail is programmed. We need to step through each part of our multi-part message and append our add text | |
| # if the current part's content_type is not an attachment... Not sure how this'll work with HTML email. | |
| self.mail_message.parts.each do |part| | |
| part.body+=add_txt unless part.disposition_is_attachment? | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment