# Parsing information from a forwarded e-mail

**URL:** <https://www.ruby-forum.com/t/parsing-information-from-a-forwarded-e-mail/78650>\
**Category:** Ruby\
**Created:** [December 7, 2006, 4:28pm UTC](https://www.ruby-forum.com/t/parsing-information-from-a-forwarded-e-mail/78650 "2006-12-07T16:28:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![soulchild](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f05b48/32.png) [@soulchild](https://www.ruby-forum.com/u/soulchild)\
**Post date:** [December 7, 2006, 4:28pm UTC](https://www.ruby-forum.com/t/parsing-information-from-a-forwarded-e-mail/78650/1 "2006-12-07T16:28:24Z")

</div>

Is there an easy way to parse out the information in a forwarded e-mail  
from Outlook on a MAPI server ABOUT the original message? e.g. The date,  
time, and e-mail address of the original sender, not the person who  
forwarded it? Also, how does one get the sender’s e-mail address out of  
a regular email?

---

<div class="post-metadata">

**Author:** ![soulchild](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f05b48/32.png) [@soulchild](https://www.ruby-forum.com/u/soulchild)\
**Post date:** [December 7, 2006, 7:46pm UTC](https://www.ruby-forum.com/t/parsing-information-from-a-forwarded-e-mail/78650/2 "2006-12-07T19:46:23Z")

</div>

Omar Zeid wrote:

> Is there an easy way to parse out the information in a forwarded e-mail  
> from Outlook on a MAPI server ABOUT the original message? e.g. The date,  
> time, and e-mail address of the original sender, not the person who  
> forwarded it? Also, how does one get the sender’s e-mail address out of  
> a regular email?

Not everyone uses Outlook, and there typically are differences between  
applications and environments in how e-mail information is formatted, so  
please post a sample of the sort of data you need to parse. Someone will  
then offer a solution based on that specific format.

As to the second question, the e-mail’s header should contain  
information  
about the sender, although it is important to remember that this header  
information can easily be faked.

---

<div class="post-metadata">

**Author:** ![soulchild](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f05b48/32.png) [@soulchild](https://www.ruby-forum.com/u/soulchild)\
**Post date:** [December 8, 2006, 4:06pm UTC](https://www.ruby-forum.com/t/parsing-information-from-a-forwarded-e-mail/78650/3 "2006-12-08T16:06:49Z")

</div>

Paul L. wrote:

> Omar Zeid wrote:
> 
> > Is there an easy way to parse out the information in a forwarded e-mail  
> > from Outlook on a MAPI server ABOUT the original message? e.g. The date,  
> > time, and e-mail address of the original sender, not the person who  
> > forwarded it? Also, how does one get the sender’s e-mail address out of  
> > a regular email?
> 
> Not everyone uses Outlook, and there typically are differences between  
> applications and environments in how e-mail information is formatted, so  
> please post a sample of the sort of data you need to parse. Someone will  
> then offer a solution based on that specific format.
> 
> As to the second question, the e-mail’s header should contain  
> information  
> about the sender, although it is important to remember that this header  
> information can easily be faked.

I’m kind of new to programming in general, so you may have to dumb down  
your response a bit. What do you mean by application, environment, and  
where would I find out what this information is in my example to even be  
able to pull a sample of data to post? Also, what exactly do you mean by  
header?
