(config, to, messageFile)
return resultDeferred
Sends an email
Sends an email
Sends an email
def sendmail(config, to, messageFile):
    """
    Sends an email
    """
    contextFactory = ClientContextFactory()

    # evilaliv3:
    #   in order to understand and before change this settings please
    #   read the comment inside tor2web.utils.tls
    contextFactory.method = SSL.SSLv23_METHOD

    resultDeferred = defer.Deferred()

    senderFactory = ESMTPSenderFactory(
        config.smtpuser.encode('utf-8'),
        config.smtppass.encode('utf-8'),
        config.smtpmail,
        to,
        messageFile,
        resultDeferred,
        contextFactory=contextFactory,
        requireAuthentication=True,
        requireTransportSecurity=(config.smtpsecurity != 'SSL'),
        retries=0,
        timeout=15)

    if config.security == "SSL":
        senderFactory = tls.TLSMemoryBIOFactory(contextFactory, True, senderFactory)

    reactor.connectTCP(config.smtpdomain, config.smtpport, senderFactory)

    return resultDeferred
def sendmail ( config , to , messageFile ) : contextFactory = ClientContextFactory ( ) # evilaliv3: #   in order to understand and before change this settings please #   read the comment inside tor2web.utils.tls contextFactory . method = SSL . SSLv23_METHOD resultDeferred = defer . Deferred ( ) senderFactory = ESMTPSenderFactory ( config . smtpuser . encode ( 'utf-8' ) , config . smtppass . encode ( 'utf-8' ) , config . smtpmail , to , messageFile , resultDeferred , contextFactory = contextFactory , requireAuthentication = True , requireTransportSecurity = ( config . smtpsecurity != 'SSL' ) , retries = 0 , timeout = 15 ) if config . security == "SSL" : senderFactory = tls . TLSMemoryBIOFactory ( contextFactory , True , senderFactory ) reactor . connectTCP ( config . smtpdomain , config . smtpport , senderFactory ) return resultDeferred