“To” parameter not working in MailTo links in Windows

p33p!n9

New Member
For some reason the "To" parameter is working on my Mac in Gmail and Outlook. But when I try the links in Windows they don't work in any browser and for any client. What gives?Now as a little backdrop, I am building the links using some JavaScript. Below is my code. Maybe I am doing this wrong. It is just odd that this would be a problem in Windows only and not be dependent on the browser or mail client.Code:\[code\]<div class="customsms-model-box email-modal share-modal sms-modal"> <div class="modal-title">Send a link via SMS</div> <form id="email-box"> <div class="email-info"> Web access on phone is required to view the full list. Standard text message rates from your carrier will apply. You will be sending this SMS message through your e-mail program. We will build everything for you. You will just have to send it. </div> <div class="mobile-carrier"> <span class="carrier-label">Mobile carrier:&nbsp;</span> <select name="email_to_email"> <option value='' selected="selected">Select one</option> <?php print users_carrier_options(); ?> </select> </div> <div class="recipient-phone"> <span class="recipients-phone">Recipient's phone:&nbsp;</span> <input type="text" name="phone_number" value="" /><br> <span class="subnote">Enter phone number including area code. Numbers only, no other characters.</span> </div> <div class="email-buttons"> <a href="http://stackoverflow.com/questions/15577378/#" class="orange-link send-mail" target="_blank">Send link</a> <a href="http://stackoverflow.com/questions/15577378/#" class="simple-link cancel close">Cancel</a> </div> </form></div><div class="email_body" ref="<?php print $list->id; ?>">Follow the URL to see my items! <?php print $smsLink; ?></div><div class="email_subject" ref="<?php print $list->id; ?>">SOME COMPANY SUBJECT</div><script>jQuery(document).ready(function($) { var eBody = $('#modal-content .email_body').text(); var eSubject = $('#modal-content .email_subject').text(); var eTo = ""; var eFrom = "<?php print $user->mail; ?>"; update_email(); $('a.send-mail').click(function() { if (eTo == '') { alert("You must enter an email address!"); return false; } }); //Replace this with something for the SMS carrier emailTo stuff $(".mobile-carrier select").change(function(){ if ($(this).val() != '') { update_to(true); } }); $(".recipient-phone input").change(function(){ if ($(this).val() != '') { update_to(); } }); function update_to(calledBySelect) { if (calledBySelect != true) { calledBySelect = false; } var phone = $(".recipient-phone input").val().replace(/[^\d.]/g, ""); //Get the phone number and leave only digits //A little validation if (phone.length != 10 && !calledBySelect) { alert('You must put in a 10 digit phone number.'); return false; } var carrier = $('.mobile-carrier select').val();//Gotta load the carrier domain eTo = phone + '@' + carrier; //Build the email to address update_email(); //Make sure all of this gets updated } function update_email() { $('.email-buttons a.send-mail').attr( 'href', 'mailto:?subject=' + encodeURIComponent(eSubject) + '&body=' + encodeURIComponent(eBody) + '&to=' + encodeURIComponent(eTo) + '&from=' + encodeURIComponent(eFrom) ); }});</script>\[/code\]
 
Back
Top