Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I was wondering if I could get some help with sending attachments via email using sendmail. I can get my script to send regular text emails but I'm not sure how to append attachments. Here is my code so far:
my $mailprog = '/usr/lib/sendmail'; foreach my $dirContent ( @dirContents ) { open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n"; print MAIL "Reply-to:jc\@home.com\n"; print MAIL "Subject: $dirContent\n"; print MAIL"The file $dirContent is attached.\n"; } close (MAIL);
I think I can use send to send out attachments, but I'm not quite sure how this works.
Any ideas? Thanks!
jc
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sending email attachments
by MrCromeDome (Deacon) on Jul 24, 2003 at 21:40 UTC | |
|
Re: Sending email attachments
by Willard B. Trophy (Hermit) on Jul 24, 2003 at 21:43 UTC | |
by simonm (Vicar) on Jul 24, 2003 at 22:51 UTC | |
|
Re: Sending email attachments
by Limbic~Region (Chancellor) on Jul 24, 2003 at 22:41 UTC | |
by spartan (Pilgrim) on Jul 25, 2003 at 23:15 UTC | |
by Limbic~Region (Chancellor) on Jul 25, 2003 at 23:33 UTC | |
|
Re: Sending email attachments
by geektron (Curate) on Jul 25, 2003 at 05:21 UTC | |
|
Re: Sending email attachments
by rupesh (Hermit) on Jul 25, 2003 at 08:20 UTC | |
by Anonymous Monk on Jan 10, 2019 at 06:45 UTC |