Have an idea?

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

Library->Send Email

Has anyone used the Sawtooth Library Question that allows you to send and email from Sawtooth?  I've tried inserting the question into my survey but I get a Sawtooth Error 132 at that question when I run the survey.  I simply added the question and updated the parameters which is located in the SKIP tab.

Begin Unverified Perl
use Net::SMTP::SSL;

# Parameters
my $to = 'me@mycompany.com';
my $subject = 'Alert';
my $body = 'Concern recorded';
my $authUser = 'me@mycompany.com';
my $authPass = 'xxxxxxx';

my $smtp = Net::SMTP::SSL->new('smtpout.secureserver.net', Port => 25);
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
asked Mar 8, 2018 by Chris Guth Bronze (1,760 points)

1 Answer

0 votes
OK, so I was able to resolve this.  My setup didn't like the line:
use Net::SMTP::SSL;
so I remove the "SSL" portion from:
use Net::SMTP::SSL;
my $smtp = Net::SMTP::SSL->
and I no longer received the Sawtooth Error 132...but...I still didn't receive an email (using my godaddy email server). So I used our in-house email server and voila...I received the email.
answered Mar 8, 2018 by Chris Guth Bronze (1,760 points)
I know this was a long time ago, but we are having the same issues you are having. We are trying to use microsoft email server and not getting emails.  Can you provide any hints? What mail server were you using at the time?
We are using our own in-house email server through Windows 10. I believe Sawtooth now has the email send script set up in their library so you can just import it into your survey now.