Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Email program with attachments

by blacksmith (Hermit)
on Oct 09, 2001 at 23:02 UTC ( [id://117834]=note: print w/replies, xml ) Need Help??


in reply to Re: Email program with attachments
in thread Email program with attachments

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

Replies are listed 'Best First'.
Re: Re: Re: Email program with attachments
by $code or die (Deacon) on Oct 10, 2001 at 00:11 UTC
    I would say, double-check what you have on these lines:
    my $work = 'me@work.com';
    and
    ... new Mail::Sender( {smtp => 'mail.domain.com',from => $work}) ...
    I think you forgot to change either the mailserver name or your work address. It's very likely that your SMTP server rejects emails unless the sender or recipient is a valid local account. So if you still have me@work.com as an email address or the wrong mail server, then it will be rejected.

    Simon Flack ($code or die)
    $,=reverse'"ro_';s,$,\$,;s,$,lc ref sub{},e;$,
    =~y'_"' ';eval"die";print $_,lc substr$@,0,3;
      I did that once before. Talk about feeling stupid. I verified and ran the program again. Same error. I am totally stumped. In your reply you said, "It's very likely that your SMTP server rejects emails unless the sender or recipient is a valid local account." Could it be possible that the email server rejects an address if it is not on the local network? I do not know if this could be an issue since I can send email to all the email accounts I have been testing that are outside of the network when manually opening MS Outlook and attaching the files. Thanks for the help. blacksmith.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://117834]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-23 06:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found