in reply to Re: Sending Email On Windows
in thread Sending Email On Windows

my $smtp = Net::SMTPS->new('outlook.com', Port => 587, doSSL => 'star +ttls', SSL_version=>'TLSv1');

This isn't working for me. The error I get is:

SSL connect attempt failed because of handshake problems

My smtp server is supposed to be using TLS 1.2, so I'm using:

my $smtp = Net::SMTPS->new('outlook.com', Port => 587, doSSL => 'star +ttls', SSL_version=>'TLSv1_2');

but this causes $smtp to be undefined.

Replies are listed 'Best First'.
Re^3: Sending Email On Windows
by kcott (Archbishop) on Apr 12, 2023 at 19:18 UTC

    The value of the doSSL key, in the post to which you replied, was 'starttls'.

    When you viewed this it wrapped, leaving one line ending with 'star, and the next line starting with a + (probably red unless you've changed your settings) to indicate wrapping, which was followed by the remainder of the value, i.e. ttls'.

    As you have this in two code blocks, it does not appear to be a one-off typo. In both cases, you should have:

    ... doSSL => 'starttls', ...

    You should not have:

    ... doSSL => 'star +ttls', ...

    I cannot comment on the validity of the parameters to Net::SMTPS->new(...); however, blindly copying that + is definitely wrong.

    Edit (for clarity): s/on two lines/in two code blocks/

    — Ken

Re^3: Sending Email On Windows
by roho (Bishop) on Apr 13, 2023 at 04:53 UTC
    Ken's comments are correct. The plus sign for line continuation is not part of the original line. Regarding the particulars of your email server, I had to do a lot of research to formulate the correct parameters for Outlook. You must do the same for the email server you are using. I'm afraid I cannot help you there.

    "It's not how hard you work, it's how much you get done."