pmarg212
01-11-2007, 07:18 AM
Greetings,
I wrote the helloworld.pl script in my /home/mydomain/ directory (Copied below). It is just intended to send a single email. However, when I run it using "perl helloworld.pl" I get the out put: "sendmail: No recipients found, aborting..."
What is the proper way to send an email from a perl script on this server? Thanks for your help!
Paul
___THE SCRIPT____
#!/usr/bin/perl
my $sendmail = '/usr/bin/sendmail';
my $subject = "Subject: Test Messagen\n";
my $content = "Thanks for your submission.\n";
my $to = "To: me@domain.net\n";
open(SENDMAIL, "|$sendmail -oi -t") or die ("Cannot open $sendmail: $!");
print SENDMAIL "From: email@mydomain.com\n";
print SENDMAIL $to;
print SENDMAIL $subject;
print SENDMAIL $content;
close(SENDMAIL);
print "DONE.\n";
I wrote the helloworld.pl script in my /home/mydomain/ directory (Copied below). It is just intended to send a single email. However, when I run it using "perl helloworld.pl" I get the out put: "sendmail: No recipients found, aborting..."
What is the proper way to send an email from a perl script on this server? Thanks for your help!
Paul
___THE SCRIPT____
#!/usr/bin/perl
my $sendmail = '/usr/bin/sendmail';
my $subject = "Subject: Test Messagen\n";
my $content = "Thanks for your submission.\n";
my $to = "To: me@domain.net\n";
open(SENDMAIL, "|$sendmail -oi -t") or die ("Cannot open $sendmail: $!");
print SENDMAIL "From: email@mydomain.com\n";
print SENDMAIL $to;
print SENDMAIL $subject;
print SENDMAIL $content;
close(SENDMAIL);
print "DONE.\n";