softwareengineer 99
2006-Feb-17 05:55 UTC
[Rails] Accessing just the body of email in text format?
I am interested in accessing the body of the email in text format using IMAP to receive emails. So far I have tried the following #body = imap.fetch(message_id, "BODY[TEXT]") #body = imap.fetch(message_id, ["BODY[]"])[0].attr[''BODY[]''] But both of the above give me body text + the headers including Content-Type etc. How can I access just the body in text format. I appreciate your assistance. Thanks Frank --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060217/25e26567/attachment.html
softwareengineer 99
2006-Feb-17 06:25 UTC
[Rails] Accessing just the body of email in text format?
I have gotten to the part where I can access the body of the email with # email.body after passing it to my receiver function using body = imap.fetch(message_id, ["BODY[]"])[0].attr[''BODY[]''] The problem now is that I get both a text version of the email as well as the HTML version of the email. How can I just get the text version of the email. Thanks Frank softwareengineer 99 <softwareengineer99@yahoo.com> wrote: I am interested in accessing the body of the email in text format using IMAP to receive emails. So far I have tried the following #body = imap.fetch(message_id, "BODY[TEXT]") #body = imap.fetch(message_id, ["BODY[]"])[0].attr[''BODY[]''] But both of the above give me body text + the headers including Content-Type etc. How can I access just the body in text format. I appreciate your assistance. Thanks Frank --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses!_______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- What are the most popular cars? Find out at Yahoo! Autos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060217/8a2583c5/attachment.html
softwareengineer 99
2006-Feb-17 17:49 UTC
[Rails] Accessing just the body of email in text format?
Experts, I appreciate any pointers you can provide on how I can access/split the message in text form and/or extract the text only version from text and html? Currently I am able to get to this part: --------------------------------------------------------------------------------------------------------- This is my first blog post via email and I am happy about it. --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. <span style="font-size: 12pt; font-family: "Times New Roman";">This is my first blog post via email and I am happy about it.<br> </span><p> <hr size=1> Yahoo! Mail<br> <a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=38867/*http://photomail.mail.yahoo.com">Use Photomail</a> to share photos without annoying attachments. -------------------------------------------------------------------------------------- As you can see the HTML post follows the text post in the same message. How can I leave the duplicate HTML copy out? Many Thanks for your assistance Frank softwareengineer 99 <softwareengineer99@yahoo.com> wrote: I have gotten to the part where I can access the body of the email with # email.body after passing it to my receiver function using body = imap.fetch(message_id, ["BODY[]"])[0].attr[''BODY[]''] The problem now is that I get both a text version of the email as well as the HTML version of the email. How can I just get the text version of the email. Thanks Frank softwareengineer 99 <softwareengineer99@yahoo.com> wrote: I am interested in accessing the body of the email in text format using IMAP to receive emails. So far I have tried the following #body = imap.fetch(message_id, "BODY[TEXT]") #body = imap.fetch(message_id, ["BODY[]"])[0].attr[''BODY[]''] But both of the above give me body t ext + the headers including Content-Type etc. How can I access just the body in text format. I appreciate your assistance. Thanks Frank --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses!_______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- What are the most popular cars? Find out at Yahoo! Autos _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Yahoo! Mail Use Photomail to share photos without annoying attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060217/c783d6f0/attachment.html