kurian2z5
asked on
Send Email
how do i send an email using perl. when user submits form to the form.cgi, it verifies that the data is correct. how do i make it send the data by e-mail to any address.
i need full code (newbie) and whatever server settings to be set.
i need full code (newbie) and whatever server settings to be set.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
also, how do i add the sender's name ?
normally it's displayed in the from address as
<Senders Name> "Email address" but it doesnt work if i type this in $from
how would i do this in MIME Lite ?
normally it's displayed in the from address as
<Senders Name> "Email address" but it doesnt work if i type this in $from
how would i do this in MIME Lite ?
..
$mail_list .= "$ENV{'USER'}";
$mail_str = "ls -lR /dumps/* | mail -s \"clear dumps on $ENV{'HOST'} - by script\" $mail_list";
tal
$mail_list .= "$ENV{'USER'}";
$mail_str = "ls -lR /dumps/* | mail -s \"clear dumps on $ENV{'HOST'} - by script\" $mail_list";
tal
ASKER
um... how exactly does that work ?
this script scans for files under /dumps and send mail to all the files' owners .
#!/usr/local/bin/perltk -w
$dul_str = "ls -lR /dumps/* | sort -k 5 -nr | grep trn";
@dul = qx ( $dul_str ); # | sort -k 5 -r | grep trn");
$mail_list = "";
foreach $line (@dul) {
$line =~ /.*\s+(\w+)\s*ftp/;
if ($mail_list =~ /$1/) {
} else {
$mail_list .= $1."\@pop3".",";
}
}
$mail_str = "ls -lR /dumps/* | mail -s \"clear dumps on $ENV{'HOST'} - by script\" $mail_list";
system ($mail_str);
exit(1);
good luck ,
tal