No SSL support included in this Python

842 views
Skip to first unread message

e27...@gmail.com

unread,
Jun 5, 2017, 9:36:56 AM6/5/17
to web2py-users
Hello,

Having problem sending email with regular mail.auth.server, on a distant server running Apache 2.4,I tried to use the regular SMTPLIB.

I got the following message :

<type 'exceptions.RuntimeError'> No SSL support included in this Python.


Here is the script that runs fine on my local compture through Web2py.exe.

Any idea ?

    import smtplib
# Specifying the from and to addresses
body = 'Coucou. Ceci est un message SMTP de TB'
subject = 'Message SMTP de TB'
recipient = 'e27...@gmail.com'
sender = 'e27...@gmail.com'
body = "" + body + ""

headers = ["From: " + sender,
"Subject: " + subject,
"To: " + recipient,
"MIME-Version: 1.0",
"Content-Type: text/html"]
headers = "\r\n".join(headers)

# Gmail Login
username = 'e27...@gmail.com'
password = 'XXXXXXXXXX'

# Sending the mail
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
mes = server.sendmail(sender, recipient, headers + "\r\n\r\n" + body)
server.quit()

Anthony

unread,
Jun 5, 2017, 9:57:33 AM6/5/17
to web2py-users
May be a problem with your Python installation. See https://groups.google.com/d/msg/web2py/e6t_-CarABU/16tefm8XBQAJ.

Anthony
Reply all
Reply to author
Forward
0 new messages