MIME::Lite uses a harcoded require Net::SMTP;, so you can't tell it to use something else without modifying its code (or perhaps using an @INC hook, but that's fairly advanced and not something I'd necessarily recommend over the following). One possible approach would be to place your own version of Net::SMTP in @INC before any other paths with e.g. lib. However, this requires your version of Net::SMTP to also be called Net::SMTP, which means you'd need to copy Net::SMTP and modify it... personally, I actually think your suggestion of making a new module that inherits from MIME::Lite to be more elegant than that!
However, note in general you probably want to consider switching to one of the newer Email::* modules by RJBS, the current maintainer of MIME::Lite - the documentation of that module starts with:
MIME::Lite is not recommended by its current maintainer. There are a number of alternatives, like Email::MIME or MIME::Entity and Email::Sender, which you should probably use instead. MIME::Lite continues to accrue weird bug reports, and it is not receiving a large amount of refactoring due to the availability of better alternatives. Please consider using something else.
In reply to Re: Replacing a module dependency
by haukex
in thread Replacing a module dependency
by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |