# Extracting email header

**URL:** <https://www.ruby-forum.com/t/extracting-email-header/138938>\
**Category:** Rails\
**Created:** [May 29, 2008, 6:19am UTC](https://www.ruby-forum.com/t/extracting-email-header/138938 "2008-05-29T06:19:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wawa88](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b5a626/32.png) [@wawa88](https://www.ruby-forum.com/u/wawa88)\
**Post date:** [May 29, 2008, 6:19am UTC](https://www.ruby-forum.com/t/extracting-email-header/138938/1 "2008-05-29T06:19:36Z")

</div>

Hi,

I got problem in extracting email header like

From: removed\_email\_address@domain.invalid  
To: removed\_email\_address@domain.invalid  
Subject: jjjjjjj

Actually i already fetch a the received mail using fectmail to a  
ForActionMailer.txt file. But the text is contain plain text and  
attachment. I already extracting out the attachment which is lmx file.  
Currently i want to extract out the header from ForActionMailer.txt file  
and append to the lmx file.

Is it possible to do so.

Thanks
