#!/usr/bin/env python3 import nntplib addr = 'testserver' u='uname' p='pass' s = nntplib.NNTP_SSL(addr, user=u, password=p) import email.utils, datetime from email.mime.text import MIMEText msg = MIMEText("test") msg['From'] = 'no-reply@mail.pl (Jenkins CI)' msg['Newsgroups'] = 'alt.test' msg['Subject'] = 'test' msg['Date'] = email.utils.formatdate() msg['Followup-To'] = 'alt.test' msg['Organization'] = '' s.post(msg)