C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
7,616 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have application auto daily send email using smtpclient, it's still running OK before 1-Oct-2021. But from 1-Oct-2021, it send missing email, i use try catch to debug this and get exception below:
Please, give me a solution other than having to set up TLS1.2 in the application.
Thanks!
Even I'm facing the same issue:
Error log
Failure Sending mail.
Authentication failed because the remote party has closed the transport stream
Not possible to connect to the mail server smpt.office365.com on port 587"
The email Encryption method used is TLS 1.2
PORT:587
SERVER: smpt.office365.com
SSL: yes
Kindly advise, as the issue occurs after 1st oct 2021
I use automatic mailing in many applications, so I can't update all of them, I want another solution that doesn't have to update the entire application in use. Thanks!
@tuyen1644 , As the Timon said, Could you provide a code example instead of picture in your question? It will be better for us to make a test.
It' s my send mail function, you can run and check it. If you have any solution without having to edit this function, please suggest me. Thanks!!!
@tuyen1644 , based on my test, the code you provided is correct, I can use it to send the email from hotmail.com to microsoft.com successfully. The question authentication-failed-because-the-remote-party-has.html is the same as your problem. You could have a look.
Sign in to comment
8 answers
Sort by: Most helpful
Hello All,
I was facing the same issue until I upgraded the .NET version to 4.6 instead of 4.5. Please refer to this answer here
https://stackoverflow.com/a/45442874/9050439
Hopefully it helps you.
Thanks
Thank you...! Currently, I'm using .net 4.7.2 and still getting this error
Sign in to comment
Is MFA required for this account? If so, that is expected.
Do you mean to deactivate MFA from office365 or enable it?
Deactivate it for that account and allow it to use Basic Auth for SMTP
I use the account used to send emails that don't have MFA set up, so it's not because of MFA!
Sign in to comment
Same error here as well with an app developed for thousands of customers. We receive an unusual number of calls of very angry customers regarding this issue which is intermittent.
Of course I can't ask my customers to simply use another email of different providers as they use the same address for numerous years now or use paid office365 accounts...
I also made sure we use compatible version of TLS, and even with 1.1 or 1.2 , it doesn't always work.
Clearly something's wrong with Microsoft SMTP servers...
Any luck so far? I'm dealing with this same issue. Our ERP software was built on TLS 1.0 and 1.1 and now the system is only sending emails out intermittently. It's bringing our business to a halt.
No luck.
It seems Microsoft is indeed migrating all their SMTP servers to TLS 1.2 only. So Most attempts with TLS 1.0 or TLS 1.1 will simply not work from what I understand.
It seems the Framework used and the code has both to be updated to take TLS 1.2 into consideration as well.
Sign in to comment
An update on my end. The issue is resolved. Forcing TLS1.2 was the fix. I upgraded from .NET 2... to .NET v4.0.30319 and set the below:
I then had issues with registering the new .dll (i spoke incorrectly in my comment above). So when I thought the switch the TLS1.2 was not the fix, that was incorrect, the issue was that the .dll was not updating in the gac. I had to use an updated version of regasm.exe, found an updated version of gacutil.exe and also updated gacutil.exe.config.
so for example I am using this to register:
%windir%\Microsoft.NET\Framework\v4.0.30319\regasm.exe "C:\Program Files (x86)[app directory here]\DNeMailer.dll" /tlb:"C:\Program Files (x86)[app directory here]\DNeMailer.tlb"
And then to install into the gac. I had to update the version of .NET referenced in gacutil.exe.config.
"C:\Program Files (x86)[app directory here]\gacutil.exe" /i "C:\Program Files (x86)[app directory here\DNeMailer.dll"
It became obvious to me that the .dll was not updating when I was not able to uninstall the .dll from C:\Windows\assembly\
Sign in to comment
According to the MS 365 docs, deprecation of TLS 1.0 and 1.1 started in 2020. Also, according to the docs you can sent unencrypted SMTP which is not recommended though. The best approach is upgrading your systems/software to TLS 1.2.
Preparing for TLS 1.2 in Office 365 and Office 365 GCC
@AgaveJoe Yes, The Application's supports only TLS 1.0 and that has to be upgraded to TLS 1.2.
Sign in to comment
Activity