How to launch email client through & managing cc and bcc mails.

Purpose:  to open client email from javascript side which accepts single email in to and more than one emails incc and agency email in bcc.

JavaScript :

function OpenEmailClient() {

var strEmail = $(‘#<%= hdnEmail.ClientID%>’).val();

var arrEmail = strEmail.split(“;”);

// alert(strEmail);

var toEmail = ”;

var bccEmail = ”;

var ccEmail = $(‘#<%= hdnAgencyEmail.ClientID%>’).val();



bccEmail = strEmail;


else if(arrEmail.length==2)


toEmail = strEmail;


var strHref = ‘mailto:’ + toEmail + ‘?cc=’ + ccEmail + ‘&bcc=’ + bccEmail;


return false;


Taking hidden fields:   hidden fields name should be name as unique name of grid columns or cell.

<asp:hiddenfield id=”hdnEmail” runat=”server” />

<asp:hiddenfield id=”hdnAgencyEmail” runat=”server” />


‘hdnEmail.ClientID’ and ‘hdnAgencyEmail’ is hidden field which is using for storing selected email value from grid or text box from server side. function is required for opening new window with client email browser

Leave a comment

Your email address will not be published. Required fields are marked *