Hello newsgroup,
I'm glad to have a hobby that doesn't involve the tv today but wouldn't
want to start an exposition without noticing the loss in Orlando....
I've been trying to email using perl on a windows 8.1 machine. It's a
curious platypus of a platform with cygwin to give me perl, and windows
to give me an OS that gives me internet and a printer but is opaque to a
person who is trying to figure it out using dos. I typed ipconfig and
didn't see anything relevant.
Also been reading about how to send email with perl, including an
article that says there are 937 ways to send email with perl, so peeved
that my sixth pretty good try does not attain.
Current script and output:
C:\cygwin64\home\Fred\pages2\plot\alpaca>perl
alpaca6.pl
page is ydp7k1.html
host is
smtp.1and1.com
Can't locate object method "new" via package
"Email::Sender::Transport::SMTP" at
alpaca6.pl line 38.
C:\cygwin64\home\Fred\pages2\plot\alpaca>type
alpaca6.pl
use strict;
use 5.010;
use lib "template_stuff";
use html3;
use Email::Sender::Simple qw(sendmail);
use Email::Simple;
use Email::Simple::Creator;
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";
my $transport = Email::Sender::Transport::SMTP->new(
{
host => $host,
port => 587,
}
);
my $email = Email::Simple->create(
header => [
To => '"Xavier Q. Ample" <$phone>',
From => '"Bob Fishman" <
o...@example.mil>',
Subject => "don't forget to *enjoy the sauce*",
],
body => "This message is short, but at least it's cheap.\n",
);
sendmail( $email, { transport => $transport } );
}
#end script
The ftp values I have from my html library work for everything else I
use it for. cpan thinks that Email::Sender::Transport::SMTP is up to
date. I'm able to send email to this phone using gmail, but that's the
precise step that I want to cut out of this operation. I called my ISP
and learned that smtp should be TLS-enabled. Thank you for your comment.
--
Cal