Use smtp.SMTP_SSL when using tls
Added DEFAULT keyword to generated sql