perl_sending_email
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
perl_sending_email [2025/03/20 19:33] – removed - external edit (Unknown date) 127.0.0.1 | perl_sending_email [2025/03/20 19:33] (current) – ↷ Page name changed from sending_email to perl_sending_email juckins | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ==== Sending email with Perl ==== | ||
+ | < | ||
+ | # | ||
+ | |||
+ | $sysadmin = " | ||
+ | $script_name = " | ||
+ | $archive_data_dir = "/ | ||
+ | $latest_file_download = `ls -1 $archive_data_dir| tail -n 1`; | ||
+ | |||
+ | now(); | ||
+ | `echo ' | ||
+ | |||
+ | sub now { | ||
+ | $now = `date`; | ||
+ | chomp($now); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | my $email_message_file = " | ||
+ | my $now = &now(); | ||
+ | open (EMAIL, "> | ||
+ | print EMAIL " | ||
+ | print EMAIL " | ||
+ | close (EMAIL); | ||
+ | send_reminder(" | ||
+ | |||
+ | #--- | ||
+ | # send reminder if error encountered | ||
+ | # email recipient, email subject, and filename for email body will be passed in | ||
+ | #--- | ||
+ | sub send_reminder { | ||
+ | my ($recipient, | ||
+ | print LOG " | ||
+ | my $reminder_results = ""; | ||
+ | $reminder_results = system(" | ||
+ | print LOG " | ||
+ | } | ||
+ | </ |