Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8385675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:44:00+00:00 2026-06-09T17:44:00+00:00

I am using the PHPMailer library integrated in Joomla for an email component in

  • 0

I am using the PHPMailer library integrated in Joomla for an email component in Joomla. It does work quite well, however I am having an issue with users running the script with 1and1 mail servers. They can get errors like that:

2012-06-14 18:20:34 u65913791 1x1et0-1RocCH2xzU-00qzkq EE transaction error after sending of mail text: msmtp.kundenserver.de[172.19.35.7] 500 Line limit exceeded

Another example from a different user:

SMTP error from remote mail server after end of data:
host mx00.1and1.co.uk [212.227.15.134]: 500 Line limit exceeded

The line limit is not about how many lines but how many characters are actually used in a single line which 1and1 limits to 10240 characters (support answer) – which is actually 10 times more than required in RFC 2822.

I assume the issue is caused by using “wrong” line seperators when the emails is submitted so that the whole email reaches the email server as a single line. I guess that I need to make sure to insert line breaks in my script as PHPMailer fails do so.

Currently I am just receiving the HTML content from a WYSIWYG-editor and put into the PHPMailer object:

// snip, $mail2send is the JMail instance, which inherits PHPMailer
$mail2send->setSubject($mail->subject);
$mail2send->IsHTML(true);
$mail2send->setBody($mail->body);   
// snip

How can I insert the appropiate line breaks?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:44:01+00:00Added an answer on June 9, 2026 at 5:44 pm

    After further investigation the error could be identified: after several replies in an email thread an embedded HTML message had no lines break anymore. I guess an email client involved in the conversation did this.

    To overcome this problem I do a HTML-tag-safe wrapping using the following function:

    /* HTML-tag-safe wordwrap
     * from http://php.net/manual/de/function.wordwrap.php
     * by nbenitezl[arroba]gmail[dot]com
     */
    function htmlwrap(&$str, $maxLength=76, $char="\r\n"){
        $count = 0;
        $newStr = '';
        $openTag = false;
        $lenstr = strlen($str);
        for($i=0; $i<$lenstr; $i++){
            $newStr .= $str{$i};
            if($str{$i} == '<'){
                $openTag = true;
                continue;
            }
            if(($openTag) && ($str{$i} == '>')){
                $openTag = false;
                continue;
            }
            if(!$openTag){
                if($str{$i} == ' '){
                    if ($count == 0) {
                        $newStr = substr($newStr,0, -1);
                        continue;
                    } else {
                        $lastspace = $count + 1;
                    }
                }
                $count++;
                if($count==$maxLength){
                    if ($str{$i+1} != ' ' && $lastspace && ($lastspace < $count)) {
                        $tmp = ($count - $lastspace)* -1;
                        $newStr = substr($newStr,0, $tmp) . $char . substr($newStr,$tmp);
                        $count = $tmp * -1;
                    } else {
                        $newStr .= $char;
                        $count = 0;
                    }
                    $lastspace = 0;
                }
            } 
        }
    
        return $newStr;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hay I'm using PHPMailer to send some simple emails, however the function SetFrom() doesn't
I am trying to email a file that exists on my server using PHPMailer.
I'm using the PHPMailer-Lite class to build an email sending script and I'm not
i'm using drupal 6 and tries to send an email to all users by
I'm using PHPMailer to send email from PHP. My email body contains HTML format
I'm using PHPMailer 5.2.0 and Google Apps for my domain email (let say my
I'm using PHPMailer for sending activation codes to users. As far as I know,
everyone Background: I am using phpmailer to send emails. For a group of users
I'm using PHPMailer to send email. Everything is working fine except one thing. The
Problem: I send out an email (using phpmailer and sendmail) which has a complex

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.