Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automatic read/send

Status
Not open for further replies.

unixkid

IS-IT--Management
Joined
May 22, 2001
Messages
105
Location
US
Help! I'm a newbie...Need help with a Perl script that will:

1. look in a dir /opt/outbound
2. grab files and email user testguy@domainname.com with aatchments
3. create a log entry of this action

 
1 - use 'opendir'/'readdir' to get information from a directory, or even File::Find.
2 - read the FAQ section of this forum for more info on how to use sendmail and how to add attachments.
3 - use 'open' with ">>" prepended to the log file name to open the log file and append information to it. "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
 
I'm a bit confussed on the FAQ. Where do you define the list of email adrresses or who it should go to?

should it look like:
print MAIL qq~To: &quot;$title&quot; <$testguy@domainname.com>\n~;


# Print the To: field to your mail stream. You can either
# enter the recipient email by itself, or in the standard
# format of Name <address>

print MAIL qq~To: &quot;$title&quot; <$email_addr>\n~;

# If you want to send to a list, send the mail only once,
# but make each address a blind carbon copy.

print MAIL qq~Bcc: ~;
my $address = pop(@LIST);
print MAIL qq~$address~;
foreach $address (@LIST) {print MAIL qq~, $address~;}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top