I get the bellow error if i use smtp.office365.com link to send mail with flutter SmtpServer function

HandshakeException: Handshake error in client (OS Error: WRONG_VERSION_NUMBER(tls_record.cc:242))

The code that i use is bellow

final smtpServer = SmtpServer('smtp.office365.com',
        port: 587,
        ssl: true,
        username: "[email protected]",
        password: "akjsaeia",
      ignoreBadCertificate: false, 
      allowInsecure: false
    );

try {
      final sendReport = await send(message, smtpServer); 
      return true;
    } on MailerException catch (e) {
      print('Message not sent.'); 
      return false;
    }

can anyone help me to resolve this problem?

0

There are 0 best solutions below