I have a mail where I need to get the body through PHP imap functions, and then save it to the database. These letters are sent from the response system. I use this code to get the email body
$bodyText = imap_fetchbody($mbox,$v,1.2);
if(!strlen($bodyText)>0){
$bodyText = imap_fetchbody($mbox,$v,1);
}
This works fine, but also includes the original body of the message, is there any way to get a response.
All email looks like this:
**This is a test
--
Kind Regards,
-----Original Message-----
From: -------------
To:--------------------------
Subject: You have received a reply to your enquiry
New System
Date: Tue, 5 Jul 2011 16:24:28 +0200
Good day,
You have received the following reply to an enquiry you made
-------------------------------------------------------------------------------------------------
test3
--------------------------------------------------------------------------------------------------
To reply to this comment please click on the Reply To button and add the message you wish to send.**
Is there a way to get only the message body without the ORIGINAL MESSAGE USING IMAP FUNCTIONS or other PHP functions?
source
share