am receiving mail when I run the code in jupyter, but i tried in my Linux box via python am not receiving any mail.
Here is the below code:
#! /usr/bin/python
import smtplib
import ssl
port = 587
smtp_server = "smtp-mail.outlook.com"
sender = "example@outlook.com"
recipient = "example@outlook.com"
sender_password = "Password"
message = """
Subject: This is a test message
Sent using Python."""
SSL_context = ssl.create_default_context()
with smtplib.SMTP(smtp_server, port) as server:
server.starttls(context=SSL_context)
server.login(sender, sender_password)
server.sendmail(sender, recipient, message)