-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.Net 8 Preview sending email exception #91377
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsDescriptionMet exception when sending email on .Net 8. Reproduction Stepsusing var mailMessage = new MailMessage();
mailMessage.From = new MailAddress("systems@xxxxxxx.com.cn", "FromName");
mailMessage.To.Add("receiver@xxxxxx.com.cn");
mailMessage.Subject = "Test Subject";
mailMessage.Body = "Test Body";
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
using var smtpClient = new SmtpClient("smtp.office365.com", 587);
smtpClient.Credentials = new NetworkCredential("systems@xxxxxx.com.cn", "Password");
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpClient.EnableSsl = true;
smtpClient.Timeout = 5000;
smtpClient.SendCompleted += (sender, e) =>
{
Console.WriteLine(e.Error?.Message ?? string.Empty);
};
await smtpClient.SendMailAsync(mailMessage);
Console.ReadLine(); Expected behaviorException thrown from
Actual behaviorException thrown from
Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationSame code works well on .Net 7 and .Net 6, but never work on .Net 8.
|
I can reproduce the issue - I'm able to send mail with the provided repro on 6.0 and 7.0, but hit the exception on 8.0. |
Same here. In .NET 6.0 and 7.0 it works but with 8.0 i got the same exception. |
getting an EHLO from the other side too :) |
Hi @MihaZupan, is there any progress or plan on this issue? |
@CuteLeon I'm looking at the issue, I was able to reproduce as well. I'll let you know here when I find out the root cause. |
That's fantastic and thank you very much. |
Reopening to track the backport to 8.0 (RC2). |
Thank you very much @ManickaP :) |
Description
Met exception when sending email on .Net 8.
Reproduction Steps
Expected behavior
Send email successfully.
Actual behavior
Exception thrown from
await smtpClient.SendMailAsync(mailMessage);
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
Same code works well on .Net 7 and .Net 6, but never work on .Net 8.
The text was updated successfully, but these errors were encountered: