Skip to main content

Simple Python SMTP relay replacement for sendmail with SSL authentication

Project description


**ksmtp** - Simple Python SMTP relay replacement for sendmail with SSL authentication

Useful for relaying all email through an account like Gmail, without the
messy configurations of Postfix / Sendmail.


GitHub -


PyPI -

pip install ksmtp


1. pip install ksmtp

2. edit /etc/ksmtp.conf with your login credentials

3. (optional) create symlink to ksmtp to replace sendmail

ln -s `which ksmtp` /usr/sbin/sendmail

4. send test mail

ksmtp -s "some subject"

Code Usage

Sample Python Code:

import ksmtp
body="some message")

Sample Config

Warning: make sure to backup this configuraiton file! Python's pip will overwrite it on updates to this package.



## from email address
from =

## user
user =

## password
pass = password

## server
server =

## port
port = 465
#port = 587

## secure
secure = ssl
#secure = tls

## default to email address (if none specified)
#to =

## default catch-all (always CC)
#catch-all =

## default subject
#subject = default test subject


If you get an "smtplib.SMTPAuthenticationError" and your credentials are
correct, you may need to "allow less secure apps access" to your account.

Project details

Download files

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

Files for ksmtp, version 0.2.10
Filename, size File type Python version Upload date Hashes
Filename, size ksmtp-0.2.10.tar.gz (4.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page