in reply to Re^2: Attaching images to email html template help!
in thread Attaching images to email html template help!

but the images is still only showing when the $->attach(); is inside of sub email

To attach the images you need the $msg object, and as you have it, that object is lexically scoped to your email function.

Anyhow, why do you want to attach the images outside of the function?

Replies are listed 'Best First'.
Re^4: Attaching images to email html template help!
by Anonymous Monk on Mar 17, 2011 at 17:54 UTC
    Eventually I will change the email sub into a module so I can use it with another scripts I have. But that will be another battle!