Skip to:
Content
Pages
Categories
Search
Top
Bottom

Carriage returns stripped from email notifications


  • ewd910
    Participant

    @ewd910

    Hi again, my forum subscription emails are being stripped of all carriage returns, so the emails look quite messy. I thought originally it needed to be sent as HTML in order to have proper spacing, but I noticed the email notifications that I get from this board are sent as plain text but still have the proper spacing, so it’s not HTML that’s the issue. Why else would the carriage returns be stripped? Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)

  • Robin W
    Moderator

    @robin-w

    ok, I’ve just tried this on my test site with just twentyten and bbppress and it sends with carriage returns, so possible that the email system you are using or indeed the email recipient software is stripping – may be may not be.

    otherwise it could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentytwenty, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users

    Health Check & Troubleshooting

    Then come back


    ewd910
    Participant

    @ewd910

    Hey, so it turns out that if you change your email headers to send HTML, you have to replace the carriage returns with <br>’s, which is what you’re doing in your app. For some reason the str_replace line you are using wasn’t working in my case (probably a different whitespace character). But as is often the case there’s a nifty PHP function that works – https://www.php.net/manual/en/function.nl2br

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar