0

How to add line breaks in html mailto?

I have tried %0D%0A it works fine but if I tried the above code with android browser it displays as it is. Also in chrome android the spaces replaced as +. Any alternatives / solution for my problem?

I have used the code below,

<a href="mailto:recipient@example.com?subject=When%2C%20when%20is%20now%3F%20">Click me</a>

<a href="mailto:recipient@example.com?subject=Test Subject">Click me</a>

<a href="mailto:endpointadress@something.com?cc=endpointadress2@something.com&amp;subject=your subject&amp;body=Text before new line.%0D%0AText after new line.">create email</a>

Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
RajeshKumar.K
  • 221
  • 2
  • 3
  • 8

1 Answers1

0

If its the subject jsut escape the test like so:

var link = "mailto:Adviser@helpme.com&subject=" + escape("[AEP] Processing Request"); window.location.href = link;

Webezine
  • 345
  • 7
  • 22