Skip to main content

Simple tools for sending mail

Project description

PyMails


Required

Send mail

from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from PyMails import *

smtp_server = '' 
port = ''
sender_email = ''
password = ''
receiver_email = ''

## Html form
msg = MIMEMultipart('alternative')
msg['Subject'] = 'Test mail'
msg['From'] = sender_email
msg['To'] = receiver_email

html = open('./html/mail.html','r+').read()
msg.attach(MIMEText(html, 'html'))

## Without html form
msg = MIMEText('Test')
msg['Subject'] = 'Test mail'
msg['From'] = sender_email
msg['To'] = receiver_email

send_mail(smtp_server,port,sender_email,password,receiver_email,msg);

Connection test

    connection_test(smtp_server,port,sender_email,password)

Change Log

0.0.5 (05.04.2021)

  • Add connection test

0.0.1 (04.04.2021)

  • First Release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyMails-0.0.5.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file PyMails-0.0.5.tar.gz.

File metadata

  • Download URL: PyMails-0.0.5.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.2 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for PyMails-0.0.5.tar.gz
Algorithm Hash digest
SHA256 229d43a5343e17798a4db4311733b731af342dfc7cf1931e870079dbcb6af8a2
MD5 fed2729caff896d6a270909ffc484444
BLAKE2b-256 3eff8f7c23043198f38939d87b94c67e079000a84f52a6eeada3b7a0157418cf

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page