How to enter line break into mailto body command

Guess no one asked me this before and I didn’t run into this question yet. However, today I got approached with the question how line breaks can be entered in a mailto: command.
The answer can be found in RFC 2368 whereas line breaks in the body of a message must be encoded using the %0D%0A sequence, which in case is nothing else then hexadecimal for 10 (line feed) and 13 (carriage return).
A full mailto: command using this feature could look like this:

mailto:name@domain.e_t?subject=Header&body=This is the first line%0D%0AThis is the second

Strictly speaking should the white spaces also be replaced with the appropriate ASCII code which is %20 and makes the complete command to look like this:


75 thoughts on “How to enter line break into mailto body command

  1. OK after then &body command in an email I want to prime the cursor to the second line, so as not to overwrite my body.

  2. Great post, very helpful. Are there any other ‘bits’ like this for hyperlinks that do things like make text bold or italic??

  3. Pingback: How to encode special chars in mailto header information | jejanim's Blog!

  4. It’s a very helpful post. %0D%0A works well in Outlook and Gmail, but it doesn’t seem to work in Yahoo mail and Aol. Any tips on that? Thanks!

  5. Amazing. Such a simple but user friendly thing to be able to do. Thanks a lot.

  6. Hi all,
    I’m trying to send an email notification from an Orchestrator tool using JavaScript. The content in the email comes all jumbled up in a single line (see example below). Any idea on how to do line break here:

    content = “Operating System :” +guestos +
    “VM Name :” +vmName +
    “Template Name :” +tempName +
    “CPU Count :” +cpuCount +
    “Memory Size :” +memSize +
    “Datastore Name :” +datastoreName +
    “Disk Size :” +diskSize +
    “Network Name :” +networkName +
    “Host ID :” +hostId +
    “MAC address :” +macAddress;

    Operating System:rhel6_64GuestVM Name:vcac191Template Name:Test-QA-CentOS65_x64CPU Count:1Memory Size:4096Datastore Name:TESTLAB01-VMXDisk Size:75Network Name:HadoopTestHost Test Lab/host/test01MAC address:00:00:00:00:00:00


  7. I tried this in Outlook and all it did was keep the email body in one line. Here is the code I used.
    What I need it to look like:
    Great job on the referral!

    Please provide information so we can track your referral.

    1. Referred Name
    2. Job ID Number

    Employee Referral Program

    What am I missing, help would be great!

  8. hi thanks for the code. but it seems it does not work on for apple mail – won’t make a line break at all.

Leave a Reply

Your email address will not be published. Required fields are marked *