This is my second time to write a perl script, but problems occur, This script is used to send an email. It did not send any email out, although it print the word "ok" at last. What is the problem of this script?
-----The content of "test"-------------------
0|0|6|1|http://test|test|test|jpop@softhome.net| |aaqPiZY5xR5l.|0|
-----The content of "email.cgi"--------------
#!/usr/local/bin/perl
require "config.pl";
open(DATA, "$data_dir/test");
$data = <DATA>;
close(DATA);
(@info) = split (/\|/, $data);
open (MAIL,"|$mailCmd -t") | | die "Can't open $mailCmd!\n";
print MAIL "To: $info[7]\nFrom: $myEmail\n";
print MAIL "Subject: Help From $site_title\n\n";
print MAIL "Thank you for your interest in $site_title.\n\n";
print MAIL "Now, your site is not listed on $site_title. This may cause by\n";
print MAIL "This may cause by 2 reasons:\n";
print MAIL "1. There is no link to $site_title in your site\n";
print MAIL "2. The link to $site_title is wrong.\n\n";
print MAIL "The Solution:\n";
print MAIL "1. Check whether the link in your site is same as follow.\n";
print MAIL "$cgi_url/rankem.cgi?action=in&id=$i\n\n";
print MAIL "2. URL to get banners and text links:\n";
print MAIL "$recip_url\n\n";
print MAIL "If you still don't make any change within 7 days,\n";
print MAIL "your site will be deleted from the database of $site_title.\n";
print MAIL "If there is any problem, you can contact mp3searcher\@softhome.net\n\n";
print MAIL "This is the information you have submitted\n";
print MAIL "Username: $i\n";
print MAIL "E-Mail Address: $info[7]\n";
print MAIL "Site Title: $info[5]\n";
print MAIL "URL: $info[4]\n";
print MAIL "Site Description: $info[6]\n\n";
print MAIL "Thanks for joining,\nWebmaster, $site_title\n";
print MAIL "http://jpop.126.com";
close (MAIL);
print "Content-type: text/html\n\n";
print "ok";
---------------------------------------------
Thank's a lot!
-----The content of "test"-------------------
0|0|6|1|http://test|test|test|jpop@softhome.net| |aaqPiZY5xR5l.|0|
-----The content of "email.cgi"--------------
#!/usr/local/bin/perl
require "config.pl";
open(DATA, "$data_dir/test");
$data = <DATA>;
close(DATA);
(@info) = split (/\|/, $data);
open (MAIL,"|$mailCmd -t") | | die "Can't open $mailCmd!\n";
print MAIL "To: $info[7]\nFrom: $myEmail\n";
print MAIL "Subject: Help From $site_title\n\n";
print MAIL "Thank you for your interest in $site_title.\n\n";
print MAIL "Now, your site is not listed on $site_title. This may cause by\n";
print MAIL "This may cause by 2 reasons:\n";
print MAIL "1. There is no link to $site_title in your site\n";
print MAIL "2. The link to $site_title is wrong.\n\n";
print MAIL "The Solution:\n";
print MAIL "1. Check whether the link in your site is same as follow.\n";
print MAIL "$cgi_url/rankem.cgi?action=in&id=$i\n\n";
print MAIL "2. URL to get banners and text links:\n";
print MAIL "$recip_url\n\n";
print MAIL "If you still don't make any change within 7 days,\n";
print MAIL "your site will be deleted from the database of $site_title.\n";
print MAIL "If there is any problem, you can contact mp3searcher\@softhome.net\n\n";
print MAIL "This is the information you have submitted\n";
print MAIL "Username: $i\n";
print MAIL "E-Mail Address: $info[7]\n";
print MAIL "Site Title: $info[5]\n";
print MAIL "URL: $info[4]\n";
print MAIL "Site Description: $info[6]\n\n";
print MAIL "Thanks for joining,\nWebmaster, $site_title\n";
print MAIL "http://jpop.126.com";
close (MAIL);
print "Content-type: text/html\n\n";
print "ok";
---------------------------------------------
Thank's a lot!