View | Details | Raw Unified | Return to issue 114497
Collapse All | Expand All

(-)scripting/source/pyprov/mailmerge.py (-4 / +9 lines)
Lines 111-125 Link Here
111
        if dbg:
111
        if dbg:
112
            out.write("Timeout: %s\n" % str(tout))
112
            out.write("Timeout: %s\n" % str(tout))
113
113
114
        self.server = smtplib.SMTP(server, port,timeout=tout)
114
        connectiontype = xConnectionContext.getValueByName("ConnectionType")
115
        if connectiontype.upper() == "SSL":
116
            if not hasattr(smtplib, "SMTP_SSL"):
117
                raise IllegalArgumentException("Connection type is not supported: " + connectiontype, self, 1)
118
            self.server = smtplib.SMTP_SSL(server, port, timeout=tout)
119
        else:
120
            self.server = smtplib.SMTP(server, port,timeout=tout)
115
        if dbg:
121
        if dbg:
116
            self.server.set_debuglevel(1)
122
            self.server.set_debuglevel(1)
117
123
        
118
        connectiontype = xConnectionContext.getValueByName("ConnectionType")
119
        if dbg:
124
        if dbg:
120
            out.write("ConnectionType: %s\n" % str(connectiontype))
125
            out.write("ConnectionType: %s\n" % str(connectiontype))
121
126
122
        if connectiontype.upper() == 'SSL':
127
        if connectiontype.upper() == 'INSECURE':
123
            self.server.ehlo()
128
            self.server.ehlo()
124
            self.server.starttls()
129
            self.server.starttls()
125
            self.server.ehlo()
130
            self.server.ehlo()

Return to issue 114497