Before getting too far into the what I need, I want to start out that my HTML is not connected to an internal/external server (from what I have read this may be limiting my options). I really am using it as an HTML form that my employees will be able to have a standard template when sending emails. I am still really new to this so I apologize in advance if I forgot to include some important information.
I have a form that my employees will have to fill out and click a generate email button. I have everything working except the ability to format the email body. What I need to do is Bold all the Text before the answers. (IE Region: selection here) I have shorten my code to spare you how inexperienced I am.
function sendEmail() {
let reg1 = "<b>Region Name:</b> "
let reg2 = "Region Name: "
let a = document.getElementById("reg").value;
let m_to = " Main Email Addresses here"
let m_cc = "CC Email Addresses here"
var today = new Date();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
var yyyy = today.getFullYear();
today = mm + '/' + dd + '/' + yyyy;
document.location.href = "mailto:" + encodeURIComponent(m_to) + "?cc=" + encodeURIComponent(m_cc)
+ " &subject=DEAP Activation " + encodeURIComponent(b) +": NE Region " + today
+ " "
+ "&body="
+ "%0D%0A%0D%0A"
+ encodeURIComponent(bl) + "%0D%0A%0D%0A"
+ "Region Name: " + encodeURIComponent(a) + "%0D%0A"
}
I have tried:
+ reg1 + encodeURIComponent(a)
but that will display as<b>Region Name:</b>
reg2.bold() + encodeURIComponent(a)
but that yielded the same result as abovereg2.bold + encodeURIComponent(a)
that displayed asfunction bold() { [native code] }
- I also tried to change
+ "&body="
to+ "&htmlbody="
but that stopped the email form generating
Any help would be greatly appreciated