문제

I need to know if its possible to pass variables to the mailto: method.

I want to have something along the lines like this, so it opens a new email on outlook.

var email = "random@random.random"
var subject = "test"
window.href = "mailto:email?subject=subject"

Now i want to know if i can pass these variables. I don't care about the body of the email I just wanna have the email address and the subject line passed in. I can't ActiveXObject because my code is on the server side rather then the client side so it wont have permission to create objects. Or at least thats what i got from reading into opening outlook from javascripts.

도움이 되었습니까?

해결책

You are missing some quotes somewhere. Make sure your quoting looks similar to this:

window.location.href = "mailto:" + email + "?subject=" + subject;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top