![]() |
Send Mail with Perl
Ok I am running Mandrake 9.1. I wrote a simple program to test sendmail and it does not work. As soon as I reference sendmail I get a 500 server error. Do I need to install a module for perl? I installed CGI.pm already. Please see the program below.
Quote:
Oh yeah this is the results of "whereis sendmail" not sure what one to use as my path. Quote:
Any help is appreciated. Thanks, Cool Hand... |
I've had luck with the Net::SMTP module.
|
First things first, since the code uses taint checking, (-T), it will need to define a valid (and untainted) ENV{PATH}. In this case, it could be as simple as:
Code:
local $ENV{PATH} = "/usr/sbin";Third, your open to sendmail doesn't do any error checking. It's a very good idea to trap any errors that might occur on the open. After fixing these issues (of course changing the email addresses to match my own), the code worked just fine. |
| All times are GMT -5. The time now is 09:34 AM. |