How to install Perl from Command Line for Automation on Windows and Dockerfile
Introduction Often in automation, we need to install stuff from command line…
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 Often in automation, we need to install stuff from command line…
You have created some views, and want to port it to your production environment…
Introduction In this tutorial we will see: How to instantiate different classes…
Introduction We will see how we can install Python 3.7 on Windows without UI. i…
Introduction I was trying to integrate Okta with Spring, and when I deploy the…
This is regarding the timeit implementation in python. The basic requirement…
Introduction In a normal email sending code from python, I’m getting following…
Introduction In one of my app, I was using to talk to . I have used some event…
Introduction So you have a Django project, and want to run it using docker image…
Introduction It is very important to introduce few process so that your code and…
Introduction In this post, we will see a sample Jenkin Pipeline Groovy script…
Introduction We often require to execute in timed manner, i.e. to specify a max…