Need Javascript to open Outlook and send email from inside sl360

Dec 21, 2022

I am a novice at JS.  Can anyone make this javascript open Outlook, send an email to a specific mailto: address, so learners can ask questions?

Here is my current JS

var player = GetPlayer();
var email='';
var subject='VCI Complaint Management Question';
var feedback=player.GetVar('MyQuestion');
var emailBody = +feedback
var mailto_link='mailto:'+email+'?subject='+subject+'&body='+encodeURIComponent(emailBody);,'');

8 Replies
Walt Hamilton

I'm not in a position to test your script, but one thing comes to mind. If it isn't working at all (you didn't say what is happening,) you might consider changing ' to ".  There have been reports of SL having problems with changing ' to something that doesn't work.

Also, if you are using Outlook as a generic term to mean email app, fine. But if you want Outlook specifically, the mailto command opens the default email, and is under the control of the settings on the learner's computer, not yours.  See Maria's first post in this thread:

Jürgen Schoenemeyer


var player   = GetPlayer();
var feedback = player.GetVar('MyQuestion');

var email = '';
var subject = 'VCI Complaint Management Question';

var emailBody = feedback;
var mailto_link = 'mailto:'+email+'?subject='+subject+'&body='+encodeURIComponent(emailBody);,'_self');