Thank you for your continued attention. I can type again and give better reports of what is or is not happening. I think my values of lexical variables going into it are correct. Again, I use ellipses for values I'd rather not splash all over the net. Output:
page is 7ae191.html host is smtp.1and1.com phone is ...@txt.att.net username is ... password is ... ******************************************************************* Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER together with SSL_ca_file|SSL_ca_path for verification. If you really don't want to verify the certificate and keep the connection open to Man-In-The-Middle attacks please set SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application. ******************************************************************* at C:/Perl/site/lib/Net/SMTP/TLS.pm line 181. invalid SSL_version specified at C:/Perl/lib/IO/Socket/SSL.pm line 389 +.
Current script
#!/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}->{'smtp'}; say "host is $host"; my $phone = $config{$sub_hash}->{'phone'}; say "phone is $phone"; my $username = $config{$sub_hash}->{'username'}; say "username is $username"; my $password = $config{$sub_hash}->{'password'}; say "password is $password"; if (1) { use Net::SMTP::TLS; my $mailer = new Net::SMTP::TLS( $host, #Hello => 'some.host.name', Port => 587, #redundant User => $username, Password=> $password) or die "Unable to connect to '$host'. $@"; $mailer->mail("myself"); $mailer->to($phone); $mailer->data; $mailer->datasend($link); $mailer->dataend; $mailer->quit; } else { say '$ENV{USER} does not exists or is not defined.'; } } __END__
So again, I'm wondering how I seem to be making hard what everyone else thinks is super easy....
In reply to Re^4: instantiating an smtp object
by Aldebaran
in thread instantiating an smtp object
by Aldebaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |