Skip to content

Instantly share code, notes, and snippets.

View RyanAquino's full-sized avatar
🏠
Working from home

Ryan Aquino RyanAquino

🏠
Working from home
View GitHub Profile
@RyanAquino
RyanAquino / email_handler.py
Created March 19, 2020 10:52
Python Sending Emails via SMTP
def send_email():
contacts = ['ryan_aquino@trendmicro.com']
msg = EmailMessage()
msg['Subject'] = 'Test subject'
msg['From'] = 'dcs_coc24x7@trendmicro.com'
msg['To'] = contacts
msg['Cc'] = contacts
@RyanAquino
RyanAquino / logger.py
Created March 19, 2020 10:51
Python Logger
import logging
from logging.handlers import TimedRotatingFileHandler
import os
log_handler = logging.getLogger(__name__)
log_handler.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
timed_handler = TimedRotatingFileHandler('jira.log', when='S', interval=1,backupCount=0)