in reply to Re^2: Network Unreachable issue while sending email using PERL (gmail)
in thread Network Unreachable issue while sending email using PERL (gmail)

It's also a nice solution, one I have used in the past because you can wrap the Transport agent code in its own module so the credentials and whatnot are not exposed in the application code.

use Email::Sender::Simple qw(sendmail); use My::Email::TransportAgent; # returns instance of Email::Sender::Tr +ansport::SMTP ... sendmail( $email, { transport => My::Email::TransportAgent->new } );

(Or create My::Email::Sender and wrap the whole thing ...)


The way forward always starts with a minimal test.