2

I'm trying to add a line break into a plain text email and after several attempts I don't seem be able to get it to work. Here's what I've tried so far:

$plain = "";
$plain .= "Roll Back Plan:\r\n\r\n";
$plain .= "Roll Back Plan:\r\n\";
$plain .= "Roll Back Plan:\n\n";
$plain .= "Roll Back Plan:\r\r\";
$plain .= "Roll Back Plan:\r";
$plain .= "Roll Back Plan:\n";
$plain .= "Roll Back Plan:" . PHP_EOL;

And none have worked so far.

I appreciate that's been asked before here.

But I've tried the suggested approaches and still nothing...

Any ideas?

EDIT:

This is for a plain text email.

EDIT2: Added raw email

Received: {{REMOVED}}} by
     {{REMOVED}}} with Microsoft SMTP Server (TLS) id 14.1.355.2;
     Tue, 3 Nov 2015 10:22:07 +0000
    Return-Path: {{REMOVED}}}
    Received: from {{REMOVED}}}
    X-Env-Sender: {{REMOVED}}}
    X-Msg-Ref: {{REMOVED}}}
    X-Originating-IP: {{REMOVED}}}
    X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
      VHJ1c3RlZCBJUDogOTQuMjM2LjExOS41ID0+IDUzMTM=\n,received_headers: No 
      Received headers
    X-StarScan-Received:
    X-StarScan-Version: 7.19.2; banners=-,-,-
    X-VirusChecked: Checked
    Received: (qmail 10991 invoked from network); 3 Nov 2015 10:22:06 -0000
    Received: {{REMOVED}}}
     (94.236.119.5)  by server-3.tower-56.messagelabs.com with
     DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 3 Nov 2015 10:22:06 -0000
    X-MSFBL: d2FnbmVyLm1hdG9zQGM0bC5jby51a0BkdnAtOTQtMjM2LTExOS01QGJnLWxvbi0w
        MUA0NzktTUVCLTI0MjoxNzYzOjIyOTA6MzkzMzowOjI5MzU6NzoxMDkzMjkz
    DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1446546126;
        s=m1; d=mktomail.com; i=@mktomail.com;
        h=Date:From:To:Subject:MIME-Version:Content-Type;
        bh=n1kHPhx5cLCEhc6ci0DYK/AkmvxaGYckMaYngTcfmCM=;
        b=Nw+P13RuK/SuT1kwJVw1YsC6vlhZBNhBS6PzBcPJeFE2scVxj65d53qFg+hjlUwZ
        OX4iIFpee8RJeQFX/3ev2GiKm4KN0+Q3V0chfvvEl5kT9ZCWObgQEj56L4UWAgPKMw8
        YZuX9lw/d1FZH0Al/RjKRD0wjITtpg+fvTxj/nY8=
    Date: Tue, 3 Nov 2015 04:22:06 -0600
    From: {{REMOVED}}}
    Reply-To: {{REMOVED}}}
    To: {{REMOVED}}}
    Message-ID: {{REMOVED}}}
    Subject: {{REMOVED}}}
    Content-Type: multipart/alternative;
        boundary="----=_Part_24932112_12312464.1446546126219"
    X-Binding: bg-lon-01
    X-MarketoID: 479-MEB-242:1763:2290:3933:0:2935:7:1093293
    X-MktArchive: false
    List-Unsubscribe: {{REMOVED}}}
    X-Mailfrom: {{REMOVED}}}
    X-MktMailDKIM: true
    X-MS-Exchange-Organization-AuthSource: {{REMOVED}}}
    X-MS-Exchange-Organization-AuthAs: Anonymous
    MIME-Version: 1.0

    ------=_Part_24932112_12312464.1446546126219
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    {{REMOVED}}}


    Some text And more text<br>And some even more


    {{REMOVED}}}



    {{REMOVED}}}

    ------=_Part_24932112_12312464.1446546126219--
Community
  • 1
  • 1
WagnerMatosUK
  • 4,309
  • 7
  • 56
  • 95
  • 1
    You can use a simple brake `
    ` tag to achieve what you're looking for.
    – Andrei Nov 03 '15 at 10:08
  • 1
    If a plaintext linebreak does not work within a plaintext mail, then you are viewing the mail as html. This is either because of a crap client or wrong content-mime-type. – Daniel W. Nov 03 '15 at 10:25
  • I don't think is a client issue as three people (three different email clients) are seeing exactly the same email (no line breaks). How can I define the `content-mime-type`? – WagnerMatosUK Nov 03 '15 at 10:27
  • There must be a context option "View (mail) Sourcecode" or something. If you see `Content-Type: text/html` in it, but not `Content-Type: text/plain`, then the type is wrong. Look at the sourcecode with a mail client. A mail can have multiple content types (multipart mail). – Daniel W. Nov 03 '15 at 10:30
  • 1
    Maybe you should post the generated email, all headers and stuff. You can leave out the recipient address. Then we can see if the mail is sent as plaintext or email. – l.renkema Nov 03 '15 at 10:31

1 Answers1

0

You can compose email body as html :

in that case you can use "</br>" tag to line break

If you wish to compose email as plain text:

use "\r\n" for line break

Akhil Thayyil
  • 9,263
  • 6
  • 34
  • 48