Python Code - How To Read CSV with Headers into an Array of Dictionary
Introduction Lets assume we have a csv something similar to following: Python…
June 15, 2022
This post has the complete code to send email through smtp server, with authentication.
We need following parameters:
from smtplib import SMTP_SSL as SMTP
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
class EmailClient:
def __init__(self):
self._mail_server = '<Your-email-smtp-server>'
self._mail_server_port = 587 # <smtp-server port number>
self._sender = "<sender email address>"
self._credentials = {
"username": "<sender email address>",
"password": "<password>"
}
def send_mail(self, recipients, subject, email_body):
msg = MIMEMultipart()
body = MIMEText(email_body, 'html')
msg['Subject'] = subject
msg.attach(body)
with SMTP(self._mail_server,port=self._mail_server_port) as conn:
conn.login(self._credentials['username'], self._credentials['password'])
conn.sendmail(self._sender, recipients, msg.as_string())
Introduction Lets assume we have a csv something similar to following: Python…
Introduction In this tutorial we will see: How to instantiate different classes…
Introduction I was trying to integrate Okta with Spring, and when I deploy the…
Introduction VS code is an excellent free IDE for maany types of programming…
Introduction I have my main website, which I run on Lets say: . Now, there is my…
Introduction To give some context, I have two python files. (Both in same folder…
Introduction In this post we will see following: How to schedule a job on cron…
Introduction There are some cases, where I need another git repository while…
Introduction In this post, we will see how to fetch multiple credentials and…
Introduction I have an automation script, that I want to run on different…
Introduction I had to write a CICD system for one of our project. I had to…
Introduction Java log4j has many ways to initialize and append the desired…