Login   Register  
PHP Classes
elePHPant
Icontem

Passing each email body into its own variable...

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Receive Mail  >  All threads  >  Passing each email body into its own variable...  >  (Un) Subscribe thread alerts  
Subject:Passing each email body into its own variable...
Summary:Passing each email body into its own variable...
Messages:3
Author:Mike Naeseth
Date:2012-06-24 22:53:11
Update:2012-06-25 05:48:55
 

  1. Passing each email body into its own variable...   Reply   Report abuse  
Picture of Mike Naeseth
Mike Naeseth
2012-06-24 22:53:11
I was able to get your class to work fine, but I need to do a little more with it.

I would like the contents of each email to be passed to a unique variable. How is this possible?

  2. Re: Passing each email body into its own variable...   Reply   Report abuse  
Picture of mitul koradia
mitul koradia
2012-06-25 05:30:40 - In reply to message 1 from Mike Naeseth
You can do that on your own. Just store each mail content in loop given in example to a new variable using $$ of PHP..

  3. Re: Passing each email body into its own variable...   Reply   Report abuse  
Picture of Mike Naeseth
Mike Naeseth
2012-06-25 05:48:55 - In reply to message 2 from mitul koradia
Ok, figured it out. I needed to pull the subject and email body into variables. I just slighly modified the loop in the example file. Heres the relevant code for other newbies like myself.

for( $i = $tot; $i > 0; $i-- )
{
$email[$i] = $obj->getBody($i);
$email_headers = $obj->getHeaders($i);
$headers_subject[$i] = $email_headers['subject'];
}



Thanks for your contributions, Mitul!