0

I have a javascript function that constructs an email and populates the address, subject and body with some contents.

Is there any way i can style some of the elements within the body?

function createEmail() {
    var email = 'mailto:' + emailAddr +
        '&subject=Postage: ' + cusPostage +
        '&body=Products:' +
                'Spoons: ' + spoonsQty +
                '<h3 style="color: #1c70db;">Hello World!</h3>';
            return email.replace(/\?/g, '');
}

Ive tried via:

'<h3 style="color: #1c70db;">Hello World!</h3>'

However when the email loads, i get to:

Spoons: 1
<h3 style= 

Using Microsoft Outlook

Oam Psy
  • 8,555
  • 32
  • 93
  • 157

1 Answers1

1

sadly, mailto link only allow plain text messages. Since you cannot set the mime type to html in the mailto link, the recieving end will process the message as plain text, even if it contains characters that look like html.