## WeBWorK Main Forum

### Questionaire problems

by Blake Thornton -
Number of replies: 3
We are having a difficult time getting questionaires working on webwork 2.2.2. Here's what we have for our questionaire:

http://www.dehn.wustl.edu/~blake/webwork/test.pg

It is essentially the same questionaire (well, trimmed down to the essentials) that we have used for several years.

The problem loads up okay but when answers are submitted (and therefore supposed to be emailed to me), I get the following error pasted in below.

Several things I've tried

1. changing the subroutine mail_answers_to2() to the subroutine mail_answers_to(). This results in an error of something with dangerous macros.
3. Deleted a lot of the subroutine mailing_problem_grader, trying to just have the necessary in there (even to the point where I just have mail_answers_to2()) but this doesn't seem to lead anywhere for me either.

(I do have the email set in course.conf, as it says I should, so that shouldn't be the problem.)

Any suggestions would be VERY helpful. Thank you!
Blake (Washington University)

### Error messages

Can't locate object method "new" via package "Net::SMTP" (perhaps you forgot to load "Net::SMTP"?) at (eval 871) line 57.

### Call stack

The information below can help locate the source of the problem.

• in WeBWorK::PG::Local::new called at line 50 of /opt/webwork2/lib/WeBWorK/PG.pm
• in WeBWorK::PG::new called at line 615 of /opt/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm
• in WeBWorK::ContentGenerator::Problem::pre_header_initialize called at line 155 of /opt/webwork2/lib/WeBWorK/ContentGenerator.pm
• in WeBWorK::ContentGenerator::go called at line 300 of /opt/webwork2/lib/WeBWorK.pm

### Re: Questionaire problems

by Michael Gage -
Hi Blake,

The sendMail capabilities became somewhat fragile with respect
to the newest versions of perl. (Technically the mail modules are doing just-in-time loading of modules they depend upon, and this bothers the Safe compartment considerably since it thinks something evil might be going on.)

In your case I think you can fix this problem by making sure that you have the CPAN module Net::SMTP installed in your perl installation where the apache server can find it. At any rate that is the first thing to check.

As I recall Net::SMTP caused the least trouble among the
various CPAN packages available for enabling an email capability.

Hope this helps. If not report back -- there are some other things to check.

Take care,

Mike

### Re: Questionaire problems

by Arnold Pizer -
Hi Blake,

I passed your question on to Sam and his response was:

Hi,

This problem was fixed in WW 2.3.1. We never determined it's exact
cause, but it probably has to do with a new version of Net::SMTP or one
of its dependencies.

It would be difficult to backport the fix into 2.2.x. My best advice is
for 2.2.x users to upgrade to 2.3.2 next week when it is released.
-sam

Unfortunately, this is not feasible in your situation. I was away, but I believe we had a similar problem at Rochester last semester. Mike was here for the fix, so I would try to follow his advice.

Arnie