Re: MIME::Lite

2010-02-01 Thread Philip Newton
2010/2/1 Chris Jack chris_j...@msn.com:

 My preconception is the email would be sent to an email queue

But you said MIME::Lite was configured to send the mails via SMTP --
so it would be speaking directly to an SMTP server, rather than
handing off the emails to a message transfer agent such as sendmail
(which would handle things such as queuing, retrying, etc.).

Cheers,
Philip
-- 
Philip Newton philip.new...@gmail.com


Re: MIME::Lite

2010-02-01 Thread Dirk Koopman

Chris Jack wrote:
 
A perl question!
 


Actually, probably an MTA configuration question.


Someone on the $email_list left the company, their email address became defunct 
and the above section of code failed. Taking them out of the distribution list 
made the code work again.
 


Many people have their MTAs check each recipient's address, it is likely 
that any (local) errors may make the whole thing fail (quickly).





Re: MIME::Lite Problem

2009-01-18 Thread Phil White
Hi Simon,

Thanks for the reply.

On Sat, 17 Jan 2009 19:01:45 +
Simon Wistow si...@thegestalt.org wrote:
 
   attach PART 
 ... snip ...
 So you should just be able to 
 
 push @{ $msg-{attach} }, $piece;

Ahh, yes - that's the easy bit :)

 $ml-attach( ('HASH' eq ref($a))? %$a : $a );

Aha! *THATS* the magic incantation!!!
I don't quite understand it, but that's why I was couldn't fix the
problem in the first place!

Thanks ever so much.

Best regards,

Phil


Re: MIME::Lite Problem

2009-01-18 Thread Dirk Koopman

Phil White wrote:



$ml-attach( ('HASH' eq ref($a))? %$a : $a );


Aha! *THATS* the magic incantation!!!
I don't quite understand it, but that's why I was couldn't fix the
problem in the first place!



It means: if $a is a hash reference, then expand it out into key/value 
pairs, otherwise (i.e. it's a simple scalar or a reference to something 
else), just pass it as it is.


Re: MIME::Lite Problem

2009-01-17 Thread Simon Wistow
On Sat, Jan 17, 2009 at 06:08:56AM +, Phil White said:
 A summary of the code is given below. What I need to be able to do, is
 create a new multipart container, and attach this to the aforementioned
 anonymous hash - it is this part that I am failing on...

From the docs

  attach PART 

  Instance method. Add a new part to this message, and return the new 
  part.

  If you supply a single PART argument, it will be regarded as a 
  MIME::Lite object to be attached.

So you should just be able to 

push @{ $msg-{attach} }, $piece;

and then change send() to say

foreach my $a (@{ $msg-{attach} || [] }) {
$ml-attach( ('HASH' eq ref($a))? %$a : $a );
}