Closed leealexander closed 1 month ago
Tagging subscribers to this area: @dotnet/ncl See info in area-owners.md if you want to be subscribed.
Author: | leealexander |
---|---|
Assignees: | - |
Labels: | `area-System.Net`, `untriaged` |
Milestone: | - |
Use MailKit instead to make life easier: https://learn.microsoft.com/en-us/dotnet/api/system.net.mail.smtpclient?view=net-8.0#remarks
Edit: Oh glad to see you already do that.
we should investigate if this is regression.
We can confirm this issue, since the update from 6.0 to 8.0, some emails are no longer sent without any exceptions being thrown. The problem does not occur in our development environments but only in the production environment (Azure AKS + Docker). When using Send instead of SendMailAsync, the problem no longer occurs.
We are using the following Docker images: mcr.microsoft.com/dotnet/aspnet:8.0.0-bookworm-slim-amd64 mcr.microsoft.com/dotnet/sdk:8.0.100
this seems like regression from https://github.com/dotnet/runtime/pull/82644. When I sync one change back it works. Can you please take a look @filipnavara ?
@filipnavara will you be able to take a look or should we jump on it? Thanks!
@filipnavara will you be able to take a look or should we jump on it? Thanks!
I have been sick for the last week so my schedule is a bit behind and I cannot make any new commitments at the moment. It's on my radar, just with low priority.
I skimmed over Stephen's PR once again but I didn't see anything obviously wrong.
I have been sick for the last week so my schedule is a bit behind and I cannot make any new commitments at the moment. It's on my radar, just with low priority.
Sorry to hear that, thanks for info! We might try to pick it up later on.
One option would be to refer the offending change and/or add more tests. Then we can proceed as time permits.
Description
We utilized
SmtpClient.SendAsync
for email dispatch, yet faced user reports of undelivered emails, despite our system appearing functional. The issue was eventually linked to specific HTML email body content, suggesting a possible size-related problem—removing a few lines from the email body seemed to resolve the sending issue.Our emails are sent via Office 365 (there are no logs for the failed emails). To eliminate the possibility of the issue being specific to Office 365, I also tried using a different email provider, but encountered the same problem.
Note this issue only started after we switched to .NET 8 from .NET 6. Also if we change to the synchronous version of the Send method it delivers the email.
Reproduction Steps
I have attached a small console application that replicates the issue. You will of course need to supply your own credentials and delivery emails. TestSendEmail.zip
Expected behavior
Expect delivery of emails.
Actual behavior
Nothing is sent.
Regression?
.NET 6 works
Known Workarounds
Use
SmtpClient.Send
instead or in our case we moved to MailKit.Configuration
.NET 8 Windows 11 x64 - although it also fails on docker image mcr.microsoft.com/dotnet/sdk:8.0-alpine as well
Other information
No response