I am writing this code so that when someone wants to send an email using Gmail then they can just use the link template and an automatic email is prepared, so the function is:
var sendGmail = function(opts){
var str = 'http://mail.google.com/mail/?view=cm&fs=1'+
'&to=' + opts.to +
'&su=' + opts.subject +
'&body=' + opts.message.replace(/\n/g,'%0A') +
'&ui=1';
location.href = str;
}
sendGmail({
to: '[email protected]',
subject: 'Invice number: '+value,
message: 'Poštovani, \n'+
' \n'+
'Dostavljamo Vam račun za isporučene usluge \n'+
'Račun je automatski generisan obradom podataka i važeći je bez pečata i potpisa \n'+
' \n'+
'*račun u papirnom obliku šaljemo Vam na zahtev \n'+
' \n'+
'Ovo je link na kome mozete racun skinuti u PDF formatu: http://agroagro.com/netRacuni/tcpdf/examples/pdf.php?kljuc='+data+' \n' +
' \n'+
' \n'+
' \n'+
'Srdačan pozdrav i hvala na ukazanom poverenju. \n'
});
And this code works fine for plain a text email, but how I can send HTML to gmail to create a HTML based email template?
Is that possible with this way?
I tried:
sendGmail({
to: '[email protected]',
subject: 'Invice number: '+value,
message: '<h1>Poštovani </h1> etc....
But this doesn't work. How I can send HTML code to gmail to render that as HTML and not as plain text?