Index: scripting/source/pyprov/mailmerge.py =================================================================== --- scripting/source/pyprov/mailmerge.py (revision 1709638) +++ scripting/source/pyprov/mailmerge.py (working copy) @@ -111,15 +111,20 @@ if dbg: out.write("Timeout: %s\n" % str(tout)) - self.server = smtplib.SMTP(server, port,timeout=tout) + connectiontype = xConnectionContext.getValueByName("ConnectionType") + if connectiontype.upper() == "SSL": + if not hasattr(smtplib, "SMTP_SSL"): + raise IllegalArgumentException("Connection type is not supported: " + connectiontype, self, 1) + self.server = smtplib.SMTP_SSL(server, port, timeout=tout) + else: + self.server = smtplib.SMTP(server, port,timeout=tout) if dbg: self.server.set_debuglevel(1) - - connectiontype = xConnectionContext.getValueByName("ConnectionType") + if dbg: out.write("ConnectionType: %s\n" % str(connectiontype)) - if connectiontype.upper() == 'SSL': + if connectiontype.upper() == 'INSECURE': self.server.ehlo() self.server.starttls() self.server.ehlo()