Using Python to send email

Using Python to send email

I'm trying to use Python to send an email.  The code below works right up to the send mail bit.  After that, it hangs and crashes.  I've seen other people on here with the same issue, but never an answer as to how they got it to work.  I would appreciate it if we could get an answer that is both definitive and can stay on here for other people to use when they run into this issue.  I've checked the responses.  Everything is normal and clean right up to the session.sendmail line.

The code:
import urllib
import ssl
import smtplib


   
user = ' ldraper@XXXXXXX.net'
password = 'XXXXXXX'

recipients = [' 5555555555@vtext.com']
sender = ' ldraper@XXXXXXX.net'
message = "test"

session = smtplib.SMTP_SSL('smtp.zoho.com', 465)
session.login(user, password)
session.sendmail(sender, recipients, message)
session.close()
exit()