For TLS you can try Net::SMTP::TLS and take eval out. since its a bad idea to use it with Net::SMTP.
#!/usr/bin/perl -w use strict; use 5.010; use lib "template_stuff"; use html3; sub rndStr{ join'', @_[ map{ rand @_ } 1 .. shift ] } my $new_name = rndStr( 5, 'a'..'z', 1..9); my $ref_to_name = \$new_name; my $return_page = create_page($ref_to_name); say "page is $return_page"; email_link($return_page); sub email_link{ use strict; use 5.014; use Net::SMTP; use config2; my $link = shift; my $sub_hash = "my_ftp"; my $host = $config{$sub_hash}->{'site'}; say "host is $host"; my $phone = $config{$sub_hash}->{'phone'}; say "phone is $phone"; if (exists $ENV{USER} && $ENV{USER}) { use Net::SMTP::TLS; my $mailer = new Net::SMTP::TLS( $host, #Hello => 'some.host.name', Port => 25, #redundant User => 'emailguy', Password=> 's3cr3t') or die "Unable to connect to '$host'. $@"; $mailer->mail($ENV{USER}); $mailer->to($phone); $mailer->data; $mailer->datasend($link); $mailer->dataend; $mailer->quit; } else { say '$ENV{USER} does not exists or is not defined.'; } } __END__
In reply to Re^3: instantiating an smtp object
by $h4X4_|=73}{
in thread instantiating an smtp object
by Aldebaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |