title: 5.7.0 User not authenticated in asp.net core1 with mailkit and strato server
body: <p>In asp.net core 1 app I'm trying to send email with mailkit library(version 1.8.1) to strato server. My code:</p>
  
  <pre><code>  var emailMessage = new MimeKit.MimeMessage();
    try
    {
        emailMessage.From.Add(new MimeKit.MailboxAddress("Support", "some@test.com"));
        emailMessage.To.Add(new MimeKit.MailboxAddress("", "test@test.com"));
        emailMessage.Subject = "Subject";
        var bodyBuilder = new MimeKit.BodyBuilder();
        bodyBuilder.HtmlBody = @"&lt;b&gt;Some body&lt;/b&gt;";
  
        emailMessage.Body = bodyBuilder.ToMessageBody(); 
  
        using (var client = new MailKit.Net.Smtp.SmtpClient())
        {
            client.Timeout = 15000;
            // Accept all SSL certificates (in case the server supports STARTTLS)
            client.ServerCertificateValidationCallback = (s, c, h, e) =&gt; true;
  
            await client.ConnectAsync("smtp.strato.de", 587, MailKit.Security.SecureSocketOptions.Auto);
            // Note: since we don't have an OAuth2 token, disable
            // the XOAUTH2 authentication mechanism.
            client.AuthenticationMechanisms.Remove("XOAUTH2");
  
            // Note: only needed if the SMTP server requires authentication
            await client.AuthenticateAsync(login, passord);
  
            await client.SendAsync(emailMesage);//here error!
            await client.DisconnectAsync(true);
        }
        return true;
    }
    catch (System.Exception)
    {
        return false;
    } 
  </code></pre>
  
  <p>When I'm trying to send email I get <strong>5.7.0 User not authenticated</strong>  error, despite authentication passed. The same code, for example, with gmail works fine.</p>
  
  <p>Any ideas how to fix it?</p>