![]() ![]() ![]() Remember that profiles can depend on the host as well, so consult the above article to pick the best location for your scenario. An easy way to do this is to add the line above to your PowerShell profile. But first, let’s answer another question that pops up – how can we make sure the changes to the Security Protocol value persist (they’re per-session ones). Granted, there are several other things you might need to check on or configure before you can make it work, which we will cover next. Once this is done, you can retry running the Send-MailMessage cmdlet and if the credentials specified are correct, it should work OK. This can be done by invoking the corresponding method, as follows: ::SecurityProtocol = ::Tls12 So, one thing to try, and make habit of is to configure the Security Protocol value and set it to TLS1.2. The server response was: 5.7.57 SMTP Client was not authenticated to send anonymous mail during MAIL FROM The error message received simply says something like “the server requires a secure connection” but doesn’t directly tell you what to do: Send-MailMessage: The SMTP server requires a secure connection or the client was not authenticated. This in turn creates problems with PowerShell, as connections negotiated via older/less secure protocols will get blocked. By now, you should probably be well aware that within Office 365, Microsoft has more strict requirements, and generally speaking you should be using TLS 1.2. More correctly, it uses the system default values, which even for modern (desktop) OS versions are a bit relaxed. One issue that seems to be overlooked in particular is the fact that PowerShell by default uses on older/insecure protocols. ![]() The article is by no means intended to be an exhaustive resource for all possible errors, just some of the common things I see over at the different communities. Lately I seem to run into such questions quite often, so I figured I’d put a short article outlining the most common issues one might run into when using PowerShell to send email messages via SMTP AUTH in Office 365.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |