bradcathey has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Monasterians,
I've had good success using Mail::Sendmail when just sending simple text e-mails. I want to expand my working knowledge to sending attachments. I found some helpful code at Mail::Sendmail FAQs, but frankly, I don't understand everything I'm seeing there.
My confusion starts at:
$file = $^X; open (F, $file) or die "Cannot read $file: $!"; binmode F; undef $/; $mail{body} = encode_base64(<F>); close F;
I don't get the $^X even after perusing perlvar. Or what happens in the open (F, $file).. line and the 3 lines that follow.
Can someone walk me through exactly what happens here, so I can figure out where and how to get the file attached. Do I upload it to the server first? How does this code know what file to attach? Thanks in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Wisdom sought re:mail:sendmail attachments
by hsinclai (Deacon) on Jan 24, 2005 at 04:29 UTC | |
|
Re: Wisdom sought re:mail:sendmail attachments
by YetAnotherDave (Beadle) on Jan 24, 2005 at 04:07 UTC | |
by bradcathey (Prior) on Jan 24, 2005 at 13:18 UTC | |
by YetAnotherDave (Beadle) on Jan 24, 2005 at 15:45 UTC | |
|
Re: Wisdom sought re:mail:sendmail attachments
by greenFox (Vicar) on Jan 24, 2005 at 06:27 UTC |