Search code examples
javascripthtml-emailapple-mail

How to prefill formatted html when opening email client?


First I create the formatted html:

onClick={(_) => {
        const content = `Nézd mit találtam ..<div></div`;

then assign content

window.location.href = `mailto:[email protected]?subject=Jelentkezz vagy oszd meg és nyerj 250$-t&body=${content}`

but in Apple Mail it looks like this:

enter image description here


Solution

  • Possible duplicate of this question.

    As mentioned in the answers to this question, it's not possible to format the body using HTML in mailto.

    But there are a few other possibilities to achieve the same result. I won't repeat them here, as they are already explained in detail in the other question.