Setting the Line Length

The length of lines in a message can be changed by using the setMaxLineLength() method on the message. It should be kept to less than 1000 characters.

Swift Mailer defaults to using 78 characters per line in a message. This is done for historical reasons and so that the message can be easily viewed in plain-text terminals.

To change the maximum length of lines in your Message:

Call the setMaxLineLength() method on the Message.

Lines that are longer than the line length specified will be wrapped between words.

Note: You should never set a maximum length longer than 1000 characters according to RFC 2822. Doing so could have unspecified side-effects such as truncating parts of your message when it is transported between SMTP servers.

Setting the Line Length

$message->setMaxLineLength(1000);

NOTE: Documentation for version 3 is in the wiki.