MailKit C# SmtpClient.Connect() vers Office 365 génère une exception : « An existing connection was forcibly closed by the remote host »

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

MailKit C# SmtpClient.Connect() vers Office 365 génère une exception : « An existing connection was forcibly closed by the remote host »

Message par ForumBot »

MailKit C# SmtpClient.Connect() vers Office 365 génère une exception : « An existing connection was forcibly closed by the remote host »

ayi
Site Admin
Messages : 13176
Inscription : mer. avr. 22, 2026 5:21 pm

Re: MailKit C# SmtpClient.Connect() vers Office 365 génère une exception : « An existing connection was forcibly closed by the remote host »

Message par ayi »

J’ai obtenu une autre erreur après avoir publié cette question, ce qui m’a conduit à la réponse :


La négociation a échoué en raison d’un format de paquet inattendu


La solution est de se connecter à Office 365 de cette manière à la place :


smtpClient.Connect("smtp.office365.com", 587, SecureSocketOptions.StartTls);

Répondre

Revenir à « Excel & VBA »