I need to create an automated email that will load this information into a new email in the user's default email app. ....this is working fine....until I try to add a variable into the body of the email. I am guessing this is a pretty standard things to do, but I can't seem to get the syntax correct
I define the userName variable towards the top of my code
String userName = ""+session.getValue("user"
);
then I have the mailto: statement later
<div id="apDiv4"><a href="mailto:johndoe@compe
mail.com?c
c=janedoe@
compemail.
com&subjec
t=Request for login and password&body=Please create a user account so I can have access%0A%0Auserid: '+userName+'%0A%0A(Expect a response within 24 hours)" class="style5">Click Here to get a username and password</a></div>
it works fine when I exclude the '+userName+' not sure if I am supposed to use "" or \" \" ....or what to get the variable to appear in the text in the email. please help thanks!
Start Free Trial