The Azure platform will block outbound SMTP connections on TCP port 25 for deployed VMs. This is to ensure better security for Microsoft partners and customers, protect Microsoft’s Azure platform, and conform to industry standards.
As you are using a non-enterprise subscription type (Students plan), the port restriction is expected.
However, you to use an authenticated SMTP relay service for your learning purpose. These relay services typically connect through TCP port 587. These services are used to maintain IP and domain reputation to minimize the possibility that external domains reject your messages or put them to the SPAM folder. SendGrid is one such SMTP relay service, but there are others. Using these email delivery services isn't restricted in Azure, regardless of the subscription type.
For Enterprise Dev/Test subscriptions to request to have the block removed, go to the Cannot send email (SMTP-Port 25) section of the Diagnose and Solve blade in the Azure Virtual Network resource in the Azure portal and run the diagnostic. This will exempt the qualified enterprise dev/test subscriptions automatically. After the subscription is exempted from this block and the VMs are stopped and restarted.
As you are using the student subscription, I guess you can't use the above mentioned option to release the block
----------
--please don't forget to upvote
and Accept as answer
if the reply is helpful--