Ho provato a seguire i tuoi consigli ed ho costruito il seguente codice:
#!/usr/bin/perl
use Net::SMTP;
$smtp = Net::SMTP->new(
Host => 'mailhost',
Hello => 'mail.host.net'
);
$smtp->auth ( 'user', 'passwd' );
$smtp->mail('usere');
$smtp->to('destinatario@host.net');
$smtp->data();
$smtp->datasend("To: \destinatario@host.net\n");
$smtp->datasend("\n");
$smtp->datasend("Subject:\n");
$smtp->datasend("ciao\n");
$smtp->dataend();
$smtp->quit;
Questo script posto nella cartella cgi-bin del server viene richiamato da una semplicissima form:
<html>
<head>
<title></title>
</head>
<body>
<form action="cgi-bin/prova.cgi" method="post">
<input type="submit" name="invia" valuie="invia">
</body>
</html>
Dopodiche ho cambiato i permessi allo script impostandoli a 755, ma cliccando submit nel form il server mi restituisce il seguente errore:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@latrave.h3nt.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Qualcuno ha qualche idea di quale sia il problema?

Rispondi quotando