added optimised OS codes

This commit is contained in:
sherlock 2025-04-03 19:01:46 +05:30
parent c318712180
commit 0fc0033265
4 changed files with 142 additions and 0 deletions

View file

@ -0,0 +1,14 @@
import smtplib
from email.message import EmailMessage
# the email message
msg = EmailMessage()
msg['Subject'] = 'CNP Assignment Email'
msg['From'] = 'aadit@example.com'
msg['To'] = 'shreyas@example.com' # used example.com just to not have a DNS error.
msg.set_content('Hello World. This is a message that is to be captured for the CNP FISAC II.')
#SMTP server running on localhost on port 25
with smtplib.SMTP('127.0.0.1', 25) as server:
server.set_debuglevel(1) # debug output to see the SMTP conversation (for dev log)
server.send_message(msg)