Skip to content

Instantly share code, notes, and snippets.

@tanimislam
tanimislam / test_email.py
Created January 3, 2021 20:15
testing email functionality using sender and recipient with user-defined port number
#!/usr/bin/env python3
import os, sys, numpy, smtplib, logging, datetime
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from argparse import ArgumentParser
def test_simple_email( recipient, sender, port_number ):
"""
send a simple test email from ``recipient`` to ``sender``, at ``port_number`` on the local machine, using the SMTP_ protocol.