I can not seem to figure this out. I think the problem may have to do with references, and I need more knowledge of them. But, could I still get a leg up on this one? Please point me in the right direction of the answer. I am opening and using a file named "email.txt" that is formatted like this :
'him@here.com','C:/test1.txt','C:/test2.txt','C:/test3.txt'
'her@there.com','C:/test3.txt'
'it@where.com','C:/test2.txt','C:/test1.txt'
Some people may recall this from an earlier post I made. And, thanks for those replies by the way. They were most helpful.
Now I have this script :
#!c:/perl -w
use Mail::Sender;
my $time = localtime;
my $subj_line = "Price Change Worksheet for $time";
my $work = 'me@work.com';
open(LIST, "c:/email.txt") or die $!;
my @files;
while(<LIST>) {
s/^'//;
s/'\n?$//;
@files = split /','/, $_;
my $email = shift @files;
my $sender = new Mail::Sender( {smtp => 'mail.domain.com',from => $wor
+k}) || die "$Mail::Sender::Error\n";
$sender->OpenMultipart( {to => $email,
subject => $subj_line});
$sender->Body;
$sender->SendLine('Here are the price change worksheets.');
$sender->SendFile(
{description => 'Text File',
encoding => 'Base64',
file => @files})
and print "Mail was sent OK." || die "$Mail::Sender::Error\n";
$sender->Close;
}
I am wondering how to attach all of the files listed for each individual email address into one email. I am just receiving an email with no attachments but at least I am getting the body message. The man page for Mail::Sender is located
here.
Thanks.
Blacksmith.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.