sending name instead email address usin mailto
I'm creating an in-office webpage that you can choose the people you want
to sent your mail to with check boxes, and then press a button that will
open outlook and send them an email.
I'm trying to send it with names, instead of email addresses.
Example:
Tomer Amir; John Do; ... etc. And not:
tomer@office.com; john@office.com; ...
the problem is that outlook does not recognizes the names...
my code:
function getSelectedCheckbox(){
var names = "";
$('input[name=checkboxlist]:checked').each(function() {
names += $(this).val();
});
document.getElementById('selectedrows').value = names;
}
function sendMail(){
getSelectedCheckbox();
var mails = document.getElementById('selectedrows').value;
window.open('mailto:'+mails+'?subject=subject&body=body');
}
it returns a string that looks like this:
Tomer Amir; John Do;
Thanks!
No comments:
Post a Comment