# I'd like to have a system that would allow me # to add as many images as possible to my template file here # instead of multiple hashes, is that possible? my %img_in; ... my %img_sec; ...
If I'm understanding you correctly, you want an array of hashes holding the image info:
my @imgs = ( { Type => 'image/gif', ID => 'logo', Path => '/images/logo.gif', Filename => 'logo.gif', Disposition => 'attachment', }, { Type => 'image/gif', ID => 'footer', Path => '/images/footer.gif', Filename => 'footer.gif', Disposition => 'attachment', }, # ... );
(of course, you could also fill the hashes dynamically...)
You should then be able to iterate over / attach them as follows
for my $img (@imgs ) { $msg->attach( %$img ) or die "Error adding $img->{Filename}: $!\n" +; }
In reply to Re: Attaching images to email html template help!
by Eliya
in thread Attaching images to email html template help!
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |