PHP Classes

need help in mail parsing - still one problem

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  need help in mail parsing - still...  >  (Un) Subscribe thread alerts  
Subject:need help in mail parsing - still...
Summary:it works fine but when replying.. it gets junk code from new rep
Messages:8
Author:ravi raja
Date:2012-03-27 19:16:15
Update:2012-03-29 19:24:11
 

  1. need help in mail parsing - still...   Reply   Report abuse  
Picture of ravi raja ravi raja - 2012-03-27 19:16:15
hi

thanks for great classes..

i got one error.. when replying new reply.. it gets new junk code.. as it doesnt have proper formatting in new reply.

I am even ready to pay some amount.. if you can really help me on this.. can we chat on messenger or email?

I can show u my script and can give you ftp to checkout my pipe file..

regards

  2. Re: need help in mail parsing - still...   Reply   Report abuse  
Picture of ravi raja ravi raja - 2012-03-28 05:57:59 - In reply to message 1 from ravi raja
I fixed the most of the things myself now..

two problems now

[1] when user reply via email.. he always get Mail delivery failed: returning message to sender‏. actully message goes in to database properly.. just user get this message.. dont know why.. pipe settings is proper.. and pipe.php is also chmod 755... and on top i have defined #!/usr/local/bin/php -q properly

[2] when reply is posted in database/script.. all new lines are removed.. so whole reply is in single para.. like this

how about this? Date: Wed, 28 Mar 2012 11:18:47 +0530 Subject: Fwd: [2142392426] New response submitted From: adminemail To: email ---------- Forwarded message ---------- From: Date: Wed, Mar 28, 2012 at 11:16 AM Subject: RE: [2142392426] New response submitted To: adminemail Hey > To: email > Subject: [2142392426] New response submitted > From: adminemail > Date: Tue, 27 Mar 2012 13:54:07 -0500 > > Reply submitted successfully. Your message is attached below.. > ------------------------------- > dsfdsfsd > ------------------------------- > Please keep subject as it is! >

you see no new lines.. just whole one para..

If you want to check yourself.. than I can give you script url

  3. Re: need help in mail parsing - still...   Reply   Report abuse  
Picture of ravi raja ravi raja - 2012-03-28 05:59:10 - In reply to message 1 from ravi raja
I fixed the most of the things myself now..

two problems now

[1] when user reply via email.. he always get Mail delivery failed: returning message to sender‏. actully message goes in to database properly.. just user get this message.. dont know why.. pipe settings is proper.. and pipe.php is also chmod 755... and on top i have defined #!/usr/local/bin/php -q properly

[2] when reply is posted in database/script.. all new lines are removed.. so whole reply is in single para.. like this

how about this? Date: Wed, 28 Mar 2012 11:18:47 +0530 Subject: Fwd: [2142392426] New response submitted From: adminemail To: email ---------- Forwarded message ---------- From: Date: Wed, Mar 28, 2012 at 11:16 AM Subject: RE: [2142392426] New response submitted To: adminemail Hey > To: email > Subject: [2142392426] New response submitted > From: adminemail > Date: Tue, 27 Mar 2012 13:54:07 -0500 > > Reply submitted successfully. Your message is attached below.. > ------------------------------- > dsfdsfsd > ------------------------------- > Please keep subject as it is! >

you see no new lines.. just whole one para..

If you want to check yourself.. than I can give you script url

  4. Re: need help in mail parsing - still...   Reply   Report abuse  
Picture of ravi raja ravi raja - 2012-03-28 06:27:50 - In reply to message 3 from ravi raja
I solved the first problem

so now just one problem

now new lines in reply via email... can you fix it for me please?

  5. Re: need help in mail parsing - still...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-03-29 08:26:24 - In reply to message 4 from ravi raja
Couldn't it be because you are showing the lines in HTML?

In HTML new lines should be rendered with <br> unless you are showing it in a <pre> preformatted section. If that is the case you can use the nl2br() function to convert new lines in HTML line breaks.

  6. Re: need help in mail parsing - still...   Reply   Report abuse  
Picture of ravi raja ravi raja - 2012-03-29 16:56:24 - In reply to message 5 from Manuel Lemos
I am little newbie in this PHP programming.. so parden me if I sounds noob..

You mean this right?


$headers = "MIME-Version: 1.0;\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1;\r\n";
$headers .="From: ".$from;

mail($toEmail, $subject, $message, $headers);
mail("[email protected]", $subject, $message, $headers);



Well problem is when this reply inserted in database and displayed on website..

when I forward the reply like in above code.. it works fine..

but just dont show properly..


If you want to test it out. can you please go to

helpdesk.rakesh.in/index.php

register and reply once and than reply via email.. and check it on website.. you will see all new lines removed..

English is not my first language so parden me if I am unclear

  7. Re: need help in mail parsing - still...   Reply   Report abuse  
Picture of ravi raja ravi raja - 2012-03-29 17:13:57 - In reply to message 5 from Manuel Lemos
You are genius bro.. PRE works

<td><?php echo "<pre>".$row['message']."</pre>"; ?></td>

this thing works mate cheeeeeeeeeeeeersss


  8. Re: need help in mail parsing - still...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-03-29 19:24:11 - In reply to message 7 from ravi raja
If you are going to show the message that way, you also need to use HtmlSpecialChars function to encode any characters that have special meaning in HTML, like &, < and > .