Hi Team,
We are facing below error shile sending email and Application pool restarts immediately.
Can you please provide the fix for the same
Aspnet Zero version : 8.1
Error details:
Application: w3wp.exe
CoreCLR Version: 4.700.22.55902
.NET Core Version: 3.1.32
Description: The process was terminated due to an unhandled exception.
Exception Info: MailKit.Net.Smtp.SmtpProtocolException: The SMTP server has unexpectedly disconnected.
at MailKit.Net.Smtp.SmtpStream.ReadAheadAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpStream.ReadResponseAsync(Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpStream.ReadResponse(CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.SendCommandAsync(String command, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.AuthenticateAsync(Encoding encoding, ICredentials credentials, Boolean doAsync, CancellationToken cancellationToken)
at MailKit.Net.Smtp.SmtpClient.Authenticate(Encoding encoding, ICredentials credentials, CancellationToken cancellationToken)
at MailKit.MailService.Authenticate(Encoding encoding, String userName, String password, CancellationToken cancellationToken)
at MailKit.MailService.Authenticate(String userName, String password, CancellationToken cancellationToken)
at Abp.MailKit.DefaultMailKitSmtpBuilder.ConfigureClient(SmtpClient client)
at Ksoft.Net.Emailing.KsoftMailKitSmtpBuilder.ConfigureClient(SmtpClient client)
at Abp.MailKit.DefaultMailKitSmtpBuilder.Build()
at Abp.MailKit.MailKitEmailSender.BuildSmtpClient()
at Abp.MailKit.MailKitEmailSender.SendEmailAsync(MailMessage mail)
at Abp.Net.Mail.EmailSenderBase.SendAsync(MailMessage mail, Boolean normalize)
at Ksoft.Authorization.Users.UserEmailer.ReplaceBodyAndSend(String emailAddress, String subject, StringBuilder emailTemplate, StringBuilder mailMessage)
at Ksoft.Authorization.Users.UserEmailer.SendConformationDashboardLinkAsync(Int32 ownerId, String conformationName)
at Ksoft.ConformationConfiguration.ConformationsAppService.<>c__DisplayClass66_0.<<SendEmailToAll>b__12>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_1(Object state)
at System.Threading.QueueUserWorkItemCallback.<>c.<.cctor>b__6_0(QueueUserWorkItemCallback quwi)
at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state)
at System.Threading.QueueUserWorkItemCallback.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
Faulting application name: w3wp.exe, version: 10.0.17763.1, time stamp: 0xcfdb13d8
Faulting module name: KERNELBASE.dll, version: 10.0.17763.1879, time stamp: 0x36bd1a29
Exception code: 0xe0434352
Fault offset: 0x0000000000039689
Faulting process id: 0x1b04
Faulting application start time: 0x01db636337e3d507
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: f1a47260-7a1b-4b55-8ffa-6f07047d7daf
Faulting package full name:
Faulting package-relative application ID:
1 Answer(s)
-
0
Hi @kansoftware
This seems like an environmental or configuration issue. Could you check if this helps you https://stackoverflow.com/questions/57676716/using-mailkit-the-smtp-server-has-unexpectedly-disconnected ?
If this doesn't help, could you share your SMTP provider ?