Thanks $code or die. The readme file says version 0.7.09. The code you provided works great. My knowledge of the ref command is lacking. But, I am still having a problem with email addresses outside of the SMTP server. I am recieving this error message
Error on myaccount@yahoo.com: Local user "myaccount@yahoo.com" unknown on host "mail.domain.com"
I have also tried accounts other than yahoo. If I put the addresses into a hash such as so
#!Perl -w use strict; use Mail::Sender; my $time = localtime; my $subj_line = "Price Change Worksheet for $time"; my %file = ('employee@theirjob.com'=>'P:\\PCW1.TXT','storeowner@aol.co +m'=>'P:\\PCW2.TXT'); my $work = 'me@work.com'; foreach (keys %file) { my $sender = new Mail::Sender( {smtp => 'mail.domain.com',from => $wor +k}) || die "$Mail::Sender::Error\n"; $sender->OpenMultipart( {to => $_, subject => $subj_line}); $sender->Body; $sender->SendLine('Here are the price change worksheets.'); $sender->SendFile( {description => 'Text File', encoding => 'Base64', file => $file{$_}}) and print "Mail was sent OK." || die "$Mail::Sender::Error\n"; $sender->Close; }
I have no problem sending mail outside of the company's mail server. WAIT!! WAIT!! I just tested that program again. It did NOT work. It gave me the error messages that I was receiving from the origin message of this thread. Okay, here is the kicker. It worked previously. The recipient of one of the mails even replied to it. Spoke with one of the Admins and was told that there is nothing wrong with the mail server. I am able to send out messages manually. Any ideas on what could be going on? Thanks again.
blacksmith

In reply to Re: Re: Email program with attachments by blacksmith
in thread Email program with attachments by blacksmith

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.