Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Send an email through Lighthouse


I am on Lighthouse Studio 9.6.1.  My client would like for our phone center to call respondents and conduct the survey on the phone using the online link up to a point then on a screen push a button and send the survey link to finish up the survey.

I am uploading the survey to the Light Server.  

Is this possible?

How would I do  this?

Thank you in advance.
asked Oct 15, 2020 by anonymous
I think this is achievable, but it will take some setup.  Naturally, your survey will need to have a password field that will be passed to respondents so they can collect data under the same respondent record as the caller.  To send the email, see "Send Email" from the Community Question Library:


Using that will require that you have access to an SMTP server.

You can update the "$body" to include the current password in the email body, similar to this:

my $body = 'https://example.com/...?studyname=study&password=' . GETVALUE('password');
Hi Zachary,

 I am attempting to set this up but I am getting a Sawtooth Error #132 when I test local.   See below error message.

 System Error:
 Can't locate Net/SMTP/SSL.pm in @INC (you may need to install the Net::SMTP::SSL module) (@INC contains: C:/Users/SANDY~1.SEA/DOCUME~1/20FB35~1/TESTSU~1/cgi-bin C:/Users/sandy.searcy/Documents/2020 PRJBE645 - Cereal Herbicide Pricing (Chad Greenall) - US/Test Survey/cgi-bin C:/Program Files/Sawtooth Software/Lighthouse Studio 9.6.1/perl/site/lib C:/Program Files/Sawtooth Software/Lighthouse Studio 9.6.1/perl/vendor/lib C:/Program Files/Sawtooth Software/Lighthouse Studio 9.6.1/perl/lib .) at (eval 103) line 2, line 8. BEGIN failed--compilation aborted at (eval 103) line 2, line 8.

 Below is the code I am using.

Begin Unverified Perl
use Net::SMTP::SSL;
# Parameters
my $to = 'GETVALUE('email')';
my $subject = 'Survey Invite from Kynetec - Earn $40 for your opinions';
my $body = 'xxxx&Password='.GETVALUE('Password')';
my $authUser = 'xxxx';
my $authPass = 'xxxx';
my $smtp = Net::SMTP::SSL->new('smtp.outlook.office365.com', Port => 587);
if ($smtp) {
    $smtp -> auth($authUser, $authPass);
    $smtp -> mail($authUser);
    if ($smtp -> to ($to)) {
        $smtp -> data();
        $smtp -> datasend("To: $to\n");
        $smtp -> datasend("From: $authUser\n");
        $smtp -> datasend("Subject: $subject\n");
        $smtp -> datasend("\n");
        $smtp -> datasend("$body\n");
        $smtp -> dataend();
    $smtp -> quit;
return 0;
End Unverified

Your solution to the original question

Please only use this to answer the original question. Otherwise please use comments.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

To avoid this verification in future, please log in or register.