在.NET Core的邮件组件MailKit中,使用搜狐的SendCloud(smtp.sendcloud.net)发送邮件时报下面的错误:
MailKit.Net.Smtp.SmtpCommandException: You already said HELO at MailKit.Net.Smtp.SmtpClient.Ehlo(CancellationToken cancellationToken) at MailKit.Net.Smtp.SmtpClient.Authenticate(Encoding encoding, ICredentials credentials, CancellationToken cancellationToken) at MailKit.MailService.<>c__DisplayClass47_0.<AuthenticateAsync>b__0()
把 SmtpClient.QueryCapabilitiesAfterAuthenticating 的值设置为 false 即可解决。