Need some help with a PERL script it's pretty straight forward stuff but i just dosen't seem to work, the script runs ok. but i never receive an email from it. Obviosly in the script on my server i have filled in all the correct details, propper email address, SMTP server etc. I have checked the installed perl modules on DirectAdmin and the NET::SMTP module is installed.
Here is the basic script:-
#!/usr/bin/perl -w
use Net::SMTP;
$smtp = Net::SMTP->new('smtp.yourserver.com');
$smtp->mail($ENV{USER});
$smtp->to("myemail@home.com");
$smtp->data();
$smtp->datasend("From: MailScript <mailscript@your.website>\n");
$smtp->datasend("To: myemail@home.com\n");
$smtp->datasend("Subject: myemail@home.com\n");
$smtp->datasend("Content-Type: text/plain\n");
$smtp->datasend("\n");
$smtp->datasend("Message text here\n");
$smtp->dataend();
$smtp->quit;
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head><title>Html Output</title></head>\n";
print "Finished Script
\n";
print "</body>\n";
print "</html>\n";
exit;
Any help would be greatly appriciated or even better has anyone got a simple working script i could use on my FriHost server?
TIA
TurboSquid
Here is the basic script:-
#!/usr/bin/perl -w
use Net::SMTP;
$smtp = Net::SMTP->new('smtp.yourserver.com');
$smtp->mail($ENV{USER});
$smtp->to("myemail@home.com");
$smtp->data();
$smtp->datasend("From: MailScript <mailscript@your.website>\n");
$smtp->datasend("To: myemail@home.com\n");
$smtp->datasend("Subject: myemail@home.com\n");
$smtp->datasend("Content-Type: text/plain\n");
$smtp->datasend("\n");
$smtp->datasend("Message text here\n");
$smtp->dataend();
$smtp->quit;
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head><title>Html Output</title></head>\n";
print "Finished Script
print "</body>\n";
print "</html>\n";
exit;
Any help would be greatly appriciated or even better has anyone got a simple working script i could use on my FriHost server?
TIA
TurboSquid
