PHPMailer\PHPMailer

PHPMailer::setWordWrap()publicWP 1.0

Apply word wrapping to the message body. Wraps the message body to the number of chars set in the WordWrap property. You should only do this to plain-text bodies as wrapping HTML tags may break them. This is called automatically by createBody(), so you don't need to call it yourself.

Method of the class: PHPMailer{}

No Hooks.

Return

null. Nothing (null).

Usage

$PHPMailer = new PHPMailer();
$PHPMailer->setWordWrap();

PHPMailer::setWordWrap() code WP 6.5.2

public function setWordWrap()
{
    if ($this->WordWrap < 1) {
        return;
    }

    switch ($this->message_type) {
        case 'alt':
        case 'alt_inline':
        case 'alt_attach':
        case 'alt_inline_attach':
            $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap);
            break;
        default:
            $this->Body = $this->wrapText($this->Body, $this->WordWrap);
            break;
    }
}