I run a single computer from home. OS is W8.1 Pro and I program and execute on DwimPerl. The following code:
#!/usr/bin/perl use 5.010; use Email::MIME; my $message = Email::MIME->create( header_str => [ From => 'alizze@name.se', To => 'myown@gmail.com', Subject => 'Happy birthday!', ], attributes => { encoding => 'quoted-printable', charset => 'ISO-8859-1', }, body_str => "Happy birthday to you!\n", ); # send the message use Email::Sender::Simple qw(sendmail); sendmail($message);
results in:
"unable to establish SMTP connection Trace begun at C:\Dwimperl\perl\site\lib\Email\Sender\Transport\SMTP.p +m line 95 Email::Sender::Transport::SMTP::_throw('Email::Sender::Transport::SMTP +=HASH(0x2cf10dc)', 'unable to establish SMTP connection') called at C +:\Dwimperl\perl\site\lib\Email\Sender\Transport\SMTP.pm line 62 Email::Sender::Transport::SMTP::_smtp_client('Email::Sender::Transport +::SMTP=HASH(0x2cf10dc)') called at C:\Dwimperl\perl\site\lib\Email\Se +nder\Transport\SMTP.pm line 104 Email::Sender::Transport::SMTP::send_email('Email::Sender::Transport:: +SMTP=HASH(0x2cf10dc)', 'Email::Abstract=ARRAY(0x41fd64)', 'HASH(0x41f +d74)') called at C:\Dwimperl\perl\site\lib\Email\Sender\Role\ CommonSending.pm line 27 Email::Sender::Role::CommonSending::__ANON__ at C:\Dwimperl\perl\site\ +lib\Try\Tiny.pm line 76 eval {...} at C:\Dwimperl\perl\site\lib\Try\Tiny.pm line 67 Try::Tiny::try('CODE(0x2e37d44)', 'Try::Tiny::Catch=REF(0x2cce4ec)') c +alled at C:\Dwimperl\perl\site\lib\Email\Sender\Role\CommonSending.pm + line 37 Email::Sender::Role::CommonSending::send('Email::Sender::Transport::SM +TP=HASH(0x2cf10dc)', 'Email::Abstract=ARRAY(0x41fd64)', 'HASH(0x2e37f +44)') called at C:\Dwimperl\perl\site\lib\Email\Sender\Simple .pm line 110 Email::Sender::Simple::send_email('Email::Sender::Simple', 'Email::Abs +tract=ARRAY(0x41fd64)', 'HASH(0x41fe54)') called at C:\Dwimperl\perl\ +site\lib\Email\Sender\Role\CommonSending.pm line 27 Email::Sender::Role::CommonSending::__ANON__ at C:\Dwimperl\perl\site\ +lib\Try\Tiny.pm line 76 eval {...} at C:\Dwimperl\perl\site\lib\Try\Tiny.pm line 67 Try::Tiny::try('CODE(0x41fde4)', 'Try::Tiny::Catch=REF(0x2b8b6cc)') ca +lled at C:\Dwimperl\perl\site\lib\Email\Sender\Role\CommonSending.pm +line 37 Email::Sender::Role::CommonSending::send('Email::Sender::Simple', 'Ema +il::MIME=HASH(0x2ceab2c)') called at C:\Dwimperl\perl\site\lib\Sub\Ex +porter\Util.pm line 69 Sub::Exporter::Util::__ANON__('Email::MIME=HASH(0x2ceab2c)') called at + script.pl line 21 Press any key to continue . . ."
What's missing?

In reply to unable to establish SMTP connection by perl_dan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.