Menu

How to drop HTML code from received emails?

Help
maddogmike
2008-05-02
2013-06-03
  • maddogmike

    maddogmike - 2008-05-02

    I've got PHP form generator working great.  However, when people write us messages with paragraph breaks, we get <br /><br /> in the received emails.

    Is there a way to smooth this out so we get actual breaks instead of the HTML code?

     
    • Musawir Ali

      Musawir Ali - 2008-05-02

      i think phpFormGenerator sends out HTML emails instead of text, i'm not completely sure if certain versions send text emails. if they do, then the HTML tags have to be stripped from them.

       
    • maddogmike

      maddogmike - 2008-05-12

      Yes, I'd prefer text emails.  How do I strip the HTML tags?

       
    • maddogmike

      maddogmike - 2008-05-20

      I got the answer on another board.

      Here's what I did.  I swapped this code in the process.php :

      $message=preg_replace("/(\015\012)|(\015)|(\012)/","&nbsp;<br />", $message);

      For this code:

      $message = str_replace("<br />", "\r\n", $message);

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.