I receive leads via email when someone submits a form residing on a website on which I pay to advertise. Using PHP, I can access my email account (IMAP), get and read messages, but I'm having trouble extracting certain information from the body of the email. I can explode (\n) the body but cannot figure out how to extract the needed information to populate variables in my MYSQL Insert function.
After using explode() displaying the results looks like this:
Subjects :: ADVERTISINGDOMAIN.COM - RSVP Open House Inquiry - Listing #839027
To :: [email protected]
ToName :: Matthew
From :: [email protected]
FromName :: XYZ Leads
RSVP for Open House
Listing #: 8390279
Open House Date: Sep 3, 2010
Name: John Doe
Phone: 5555555555
Email: [email protected]
Comments: Hi. I will be at the open house...looking forward to meeting you and viewing this property. Thanks. Jane
Warm Regards,
Matthew