0

How do I use the "mailto" function in JavaScript for a table containing product details

function SendEmail() {
  var email = document.getElemenById("list").value;
  window.location.href = "mailto:[email protected]?subject=enquiry &body=+ "email"";
}
1

1 Answer 1

3

What you are doing in your function is correct, but it has errors.

getElemenById should be getElementById (add the 't')

"mailto:[email protected]?subject=enquiry &body=+ "email"" should be

"mailto:[email protected]?subject=enquirt&body=" + email (remove space in between "enquirt" and "&body", correctly format end)

Finished function:

function SendEmail() {
  var email = document.getElementById("list").value;
  window.location.href = "mailto:[email protected]?subject=enquiry&body=" + email;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.