Forum Moderators: phranque
Here is the Perl script which sends mail successfully....
use Mail::Sendmail;
%mail = ( To => 'somebody@somewhere',
From => 'blah@blah',
Subject =>'sample subject',
Message => "sample message"
);
sendmail(%mail) or die("mail NOT sent \n\nERROR DETAILS: \n". $Mail::Sendmail::error);
print "Log says:\n", $Mail::Sendmail::log;
But when i am using this in my CGI script and open that cgi page from my browser, it gives an error..
Here is my CGI script which is almost same to previous one.
use CGI;
use Mail::Sendmail;
print "Content-Type: text/html\n\n";
print "<html> <head>\n";
print "<title>testmail</title>";
print "</head>\n";
print "<body>\n";
%mail = ( To => 'somebody@somewhere',
From => 'blah@blah',
Subject =>'sample subject',
Message => "sample message"
);
if(sendmail(%mail)) {print "<p>Success!";} else { print("mail NOT sent \n\nERROR DETAILS: \n". $Mail::Sendmail::error);}
print "<p>Log says:<p>\n". $Mail::Sendmail::log;
print "</body> </html>\n";
unfortunately i have never seen that "Success" :( :(
Here is the **latest** ouput in internet explorer i have seen...
mail NOT sent ERROR DETAILS: socket failed (Unknown error)
Log says:
Mail::Sendmail v. 0.79 - Tue Sep 18 15:00:45 2007 Date: Tue, 18 Sep 2007 15:00:45 +0530
...for mail server i am using Default SMTP virtual server in IIS...looking at the error type socket failed (Unknown error), I am at sea as to what after should I run! Is it Perl(nope ..i don think so!) or if is it socket error? (then what is the actual error? how can I fix an error which is termed as Unknown :( :( )
..
PLZZZZZZZZZ Help me out .. :( :( :(