I have a cgitask that takes desired e-mail information from the user (to:, cc:, subject:, etc.) and then should post to itself, create the e-mail, and use Net

MTP to send the message. However, while my basic e-mail script using Net

MTP works from an externaltask, when called from a cgitask, I do not receive an e-mail and in the error.log under iw-webd, it's logs "Can't call method 'mail' on an undefined value at <removed file name for reading> on line 505". That line is the call to.
my $smtp = Net:

MTP->new($mailserver,
Hello => 'usf.ibm.com',
Debug => 0,
);
My $mailserver variable does have a valid IP for our SMTP server. Any ideas on what I'm missing here in my cgitask?