You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

py416

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

py416 - pypi Package Compare versions

Comparing version
0.54
to
0.55
+1
-1
PKG-INFO
Metadata-Version: 2.1
Name: py416
Version: 0.54
Version: 0.55
Summary: don't question my methods

@@ -5,0 +5,0 @@ Author-email: Ezio416 <ezezio416@gmail.com>

@@ -7,3 +7,3 @@ [build-system]

name = "py416"
version = "0.54"
version = "0.55"
authors = [

@@ -10,0 +10,0 @@ { name="Ezio416", email="ezezio416@gmail.com" },

Metadata-Version: 2.1
Name: py416
Version: 0.54
Version: 0.55
Summary: don't question my methods

@@ -5,0 +5,0 @@ Author-email: Ezio416 <ezezio416@gmail.com>

@@ -5,4 +5,4 @@ '''

Created: 2022-08-15
Updated: 2022-11-10
Version: 0.54
Updated: 2022-11-11
Version: 0.55

@@ -12,3 +12,3 @@ A collection of various functions

from .general import *
__version__ = 0, 54
__version__ = 0, 55
v = __version__
'''
| Author: Ezio416
| Created: 2022-08-18
| Updated: 2022-11-10
| Updated: 2022-11-11
- Functions for various things
- These are all imported to py416 directly, so just call them like: :func:`py416.timestamp`
- These are all imported to py416 directly, so just call them like so: :func:`py416.timestamp`
'''
from datetime import datetime as dt
from email.message import EmailMessage
from re import findall
from smtplib import SMTP_SSL
from ssl import create_default_context

@@ -54,2 +57,56 @@ from .variables import SEC_D, SEC_H, SEC_M

def emailsmtp(sender_email: str, recipient: str, subject: str, body: str, smtp_server: str, smtp_port: int, password: str, sender_name: str = '') -> bool:
'''
- sends an email via SMTP
Parameters
----------
sender_email: str
- email address to send from
recipient: str
- email address to send to
subject: str
- text to put in the email subject
body: str
- test to put in the email body
smtp_server: str
- host name for SMTP server
smtp_port: int
- port for SMTP server
password: str
- password for sender email
sender_name: str
- name to show in the 'from' field
- default: none
Returns
-------
bool
- whether send was successful
'''
msg = EmailMessage()
if sender_name:
msg['From'] = f'{sender_name} <{sender_email}>'
else:
msg['From'] = sender_email
msg['To'] = recipient
msg['Subject'] = subject
msg.set_content(body)
try:
with SMTP_SSL(host=smtp_server, port=smtp_port, context=create_default_context()) as server:
server.login(sender_email, password)
server.send_message(msg)
return True
except Exception:
return False
def gettype(thing) -> str:

@@ -56,0 +113,0 @@ '''