Starting from December 2020 Sendgrid provides a new authentication method to their services.
They are the preferred alternative to using a username and password because you can revoke an API key at any time without having to change your username and password. We suggest that you use API keys for connecting to all of SendGrid’s services.
Please find here
more detailed information.
The generation of the Api key is very simple:
1-login into your Sendgrid account
2-go to "Generate Api keys" on left menu
3-click on create
Set "Restricted permissions" and enable both Mail Settings and Mail Send
4. Enter "apikey" as Username and the Api key
generated at step #3 as the Password for the outgoing SMTP server credentials.
if you have multiple applications using Sendgrid apikeys then it is highly recommended to create separated apikey for each application.