Aufruf mit: python sendmail.py doku.pdf
alles wunderbar
rufe ich es aber mit python3 sendmail.py doku.pdf auf bekomme ich folgende Fehlermeldung
Traceback (most recent call last):
File "sendmail.py", line 75, in <module>
mail.send(sys.argv[1:])
File "sendmail.py", line 45, in send
server.starttls()
File "/usr/local/lib/python3.6/smtplib.py", line 756, in starttls
raise RuntimeError("No SSL support included in this Python")
RuntimeError: No SSL support included in this Python
Code: Alles auswählen
import sys, smtplib, os
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
from email.utils import formatdate
Code: Alles auswählen
server = smtplib.SMTP(self.smtpserver)
server.ehlo() # Has something to do with sending information
server.starttls()
server.ehlo() # To make starttls work
server.login(self.username, self.password)
failed = server.sendmail(From, to, msg.as_string())
server.quit()