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()

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to