Using cc in mailto javascript
Jul 12, 2015
Hi there,
I am using JavaScript to email some results to users and this works fine.
However I would like to cc the email to someone else and have no idea how to achieve this..!!
My JavaScript (cobbled together from the community) is shown below:
var player=GetPlayer();
var email=player.GetVar("email");
var username=player.GetVar("username");
var status=player.GetVar("completion");
var subject="Results for ";
var response1 = player.GetVar("T1");
var response2 = player.GetVar("T2");
var response3 = player.GetVar("T3");
var response4 = player.GetVar("T4");
var response5 = player.GetVar("T5");
var mailto_link='mailto:'+email+' subject='+subject+username+status+'&body='+"TASK 1 - Has been Completed - "+response1+
"%0d%0A%0d%0ATASK 2 - Has been Completed - "+response2+
"%0d%0A%0d%0ATASK 3 - Has been Completed - "+response3+
"%0d%0A%0d%0ATASK 4 - Has been Completed - "+response4+
"%0d%0A%0d%0ATASK 5 - Has been Completed - "+response5+;
win=window.open(mailto_link,'emailWin');
3 Replies
Hi John,
mailto:recipient@domain.com?cc=other@domain.com&bcc=hidden@domain.com
is what you are looking for... (I have added a bcc for your convenience).
By the way... in your code is a "?" missing"...: (first a "?" to add the first parameter, then "&" for every additional parameter).
mailto:recipient@domain.com?cc=other@domain.com&bcc=hidden@domain.com&subject=Enquiry%20regarding%20product%20#0022
Source: http://rijamedia.com/blog/2010/12/email-tutorial-to-cc-bcc-subject-body-in-mailto-links/
Try Google with "html mailto cc" to get more ideas...
Remember: there is al limit of characters in your "mailto" which differs from browser to browser ("GET" limitation of characters). If your mailbody is incomplete, your entire mailto call is to long.
Cheers,
Jan
Thanks Jan
That fixed it!
Obliged for your help !!
John
Happy to hear it John and glad Jan was able to assist you here.
This discussion is closed. You can start a new discussion or contact Articulate Support.